|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--Opus5.AbstractObject
|
+--Opus5.AbstractContainer
|
+--Opus5.Deap
A double-ended priority queue implemented as a binary heap.
| Field Summary | |
protected Comparable[] |
array
The heap. |
| Fields inherited from class Opus5.AbstractContainer |
count |
| Fields inherited from interface Opus5.DoubleEndedPriorityQueue |
copyright |
| Constructor Summary | |
Deap(int length)
Constructs a Deap with the specified length. |
|
| Method Summary | |
void |
accept(Visitor visitor)
Accepts the specified visitor and makes it visit all the objects in this deap. |
protected int |
compareTo(Comparable arg)
Compares this deap with the specified comparable object. |
Comparable |
dequeueMax()
Dequeues and returns the "largest" object in this deap. |
Comparable |
dequeueMin()
Dequeues and returns the "smallest" object in this deap. |
protected int |
dual(int i)
Returns the position in this deap of the dual of the object at the specified position. |
void |
enqueue(Comparable object)
Inserts the specified object into this deap. |
Comparable |
findMax()
Returns the "largest" object in this deap. |
Comparable |
findMin()
Returns the "smallest" object in this deap. |
Enumeration |
getEnumeration()
Returns an enumeration that enumerates all the objects in this deap. |
protected void |
insertMax(int pos,
Comparable object)
Inserts the specified object starting at the specified position in the max-heap side of this deap. |
protected void |
insertMin(int pos,
Comparable object)
Inserts the specified object starting at the specified position in the min-heap side of this deap. |
boolean |
isFull()
Tests whether this deap is full. |
void |
purge()
Purges this deap, making it empty. |
| Methods inherited from class Opus5.AbstractContainer |
getCount, hashCode, isEmpty, toString |
| Methods inherited from class Opus5.AbstractObject |
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface Opus5.Container |
getCount, isEmpty |
| Methods inherited from interface Opus5.Comparable |
compare, isEQ, isGE, isGT, isLE, isLT, isNE |
| Field Detail |
protected Comparable[] array
| Constructor Detail |
public Deap(int length)
Deap with the specified length.length - The desired length.| Method Detail |
public void purge()
purge in interface Containerprotected int dual(int i)
i - The specified position.public Comparable findMin()
findMin in interface PriorityQueueContainerEmptyException - If this deap is empty.public Comparable findMax()
findMax in interface DoubleEndedPriorityQueueContainerEmptyException - If this deap is empty.
protected void insertMin(int pos,
Comparable object)
pos - The position at which to start.object - The object to insert.
protected void insertMax(int pos,
Comparable object)
pos - The position at which to start.object - The object to insert.public void enqueue(Comparable object)
enqueue in interface PriorityQueueobject - The object to insert.ContainerFullException - If this deap is full.public Comparable dequeueMin()
dequeueMin in interface PriorityQueueContainerEmptyException - If this deap is empty.public Comparable dequeueMax()
dequeueMax in interface DoubleEndedPriorityQueueContainerEmptyException - If this deap is empty.public boolean isFull()
isFull in interface ContainerisFull in class AbstractContainerpublic void accept(Visitor visitor)
accept in interface Containeraccept in class AbstractContainerThe - visitor to accept.public Enumeration getEnumeration()
getEnumeration in interface Containerprotected int compareTo(Comparable arg)
compareTo in class AbstractObjectarg - The comparable object with which to compare this deap.MethodNotImplemented - Always.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||