T - The type of elements in the queue.TIterator - The type of iterators in the container.TContainer - The type of the specified container.public class PriorityQueue64<T,TIterator extends IRanIter<T,TIterator>,TContainer extends IRanSequence64<T,TIterator>>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected TContainer |
data
The underlying container of the current instance.
|
| Constructor and Description |
|---|
PriorityQueue64(TContainer data)
Constructs an empty priority queue with the default comparator.
|
PriorityQueue64(TContainer data,
IFunc2Arg<T,T,java.lang.Boolean> compare)
Constructs an empty priority queue with the specified comparator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Clear()
Erases all of the priority queue's elements.
|
TContainer |
Container()
Gets the underlying container of the current instance.
|
void |
Dequeue()
Removes the highest-priority element at the front of the priority queue.
|
boolean |
Empty()
Returns true only if the priority queue does not contain any elements.
|
void |
Enqueue(T item)
Inserts an element into the priority queue.
|
boolean |
equals(java.lang.Object obj)
Tests whether this instance is equal to a specified object.
|
boolean |
equals(PriorityQueue64<T,TIterator,TContainer> x)
Tests whether this instance is equal to a specified PriorityQueue64.
|
int |
hashCode()
Returns the hash code for this instance.
|
long |
MaxSize()
Returns the maximum possible size of the priority queue.
|
T |
Peek()
Returns (without removing) the highest-priority element at the front of
the priority queue.
|
long |
Size()
Returns the number of elements contained in the priority queue.
|
protected TContainer extends IRanSequence64<T,TIterator> data
public PriorityQueue64(TContainer data)
data - The underlying container object.public PriorityQueue64(TContainer data, IFunc2Arg<T,T,java.lang.Boolean> compare)
data - The underlying container object.compare - The specified comparator.public TContainer Container()
public long Size()
public long MaxSize()
public boolean Empty()
public T Peek()
java.lang.RuntimeException - When the priority queue is empty.public void Enqueue(T item)
item - The element added to the priority queue.java.lang.RuntimeException - When the priority queue is full.public void Dequeue()
java.lang.RuntimeException - When the priority queue is empty.public void Clear()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - An object to compare with this instance.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(PriorityQueue64<T,TIterator,TContainer> x)
x - A PriorityQueue64 to compare with this instance.Copyright© 2012 Progeneric Systems, Inc. All Rights Reserved.