|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
java.lang.Object | +--org.apache.avalon.excalibur.collections.BinaryHeap
BinaryHeap implementation of priority queue. The heap is either a minimum or maximum heap as determined by parameters passed to constructor.
| フィールドの概要 | |
static java.util.Comparator |
MAX_COMPARATOR
Comparator used to instantiate a max heap - assumes contents implement the Comparable interface. |
static java.util.Comparator |
MIN_COMPARATOR
Comparator used to instantiate a min heap - assumes contents implement the Comparable interface. |
| コンストラクタの概要 | |
BinaryHeap()
Instantiates a new min binary heap with the default initial capacity. |
|
BinaryHeap(boolean isMinHeap)
Create a binary heap of Comparables. |
|
BinaryHeap(java.util.Comparator comparator)
Instantiates a new binary heap with the default initial capacity and ordered using the given Comparator. |
|
BinaryHeap(int capacity)
Instantiates a new min binary heap with the given initial capacity. |
|
BinaryHeap(int capacity,
boolean isMinHeap)
Create a binary heap of Comparables. |
|
BinaryHeap(int capacity,
java.util.Comparator comparator)
Instantiates a new binary heap with the given initial capacity and ordered using the given Comparator. |
|
| メソッドの概要 | |
void |
clear()
Clear all elements from queue. |
void |
insert(java.lang.Object element)
Insert an element into queue. |
boolean |
isEmpty()
Test if queue is empty. |
boolean |
isFull()
Test if queue is full. |
java.lang.Object |
peek()
Return element on top of heap but don't remove it. |
java.lang.Object |
pop()
Return element on top of heap and remove it. |
int |
size()
Returns the number of elements currently on the heap. |
java.lang.String |
toString()
Create a string representing heap and all elements in heap. |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
public static final java.util.Comparator MIN_COMPARATOR
public static final java.util.Comparator MAX_COMPARATOR
| コンストラクタの詳細 |
public BinaryHeap()
public BinaryHeap(int capacity)
capacity - the size of the heappublic BinaryHeap(java.util.Comparator comparator)
comparator - to order the contents of the heap
public BinaryHeap(int capacity,
java.util.Comparator comparator)
capacity - the size of the heapcomparator - to order the contents of the heappublic BinaryHeap(boolean isMinHeap)
isMinHeap - true to make it a minimum heap, false to make it a max heap
public BinaryHeap(int capacity,
boolean isMinHeap)
capacity - the size of the heapisMinHeap - true to make it a minimum heap, false to make it a max heap| メソッドの詳細 |
public void clear()
PriorityQueue 内の clearpublic boolean isEmpty()
PriorityQueue 内の isEmptypublic boolean isFull()
public int size()
public void insert(java.lang.Object element)
PriorityQueue 内の insertelement - the element to be inserted
public java.lang.Object peek()
throws java.util.NoSuchElementException
PriorityQueue 内の peekjava.util.NoSuchElementException - if isEmpty() == true
public java.lang.Object pop()
throws java.util.NoSuchElementException
PriorityQueue 内の popjava.util.NoSuchElementException - if isEmpty() == truepublic java.lang.String toString()
java.lang.Object 内の toString
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||