|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.PriorityVector
public class PriorityVector
A vector-based implementation of a priority queue. Similar to an ordered vector, except that only the smallest value may be accessed in this structure.
OrderedVector
Field Summary | |
---|---|
protected Vector |
data
The vector of data that is maintained in increasing order. |
Constructor Summary | |
---|---|
PriorityVector()
Construct an empty priority queue. |
Method Summary | |
---|---|
void |
add(java.lang.Comparable value)
Add a comparable value to the priority queue. |
void |
clear()
Remove all the values from the priority queue. |
java.lang.Comparable |
getFirst()
Fetch the smallest value of the priority queue. |
protected int |
indexOf(java.lang.Comparable target)
|
boolean |
isEmpty()
Determine if the priority queue is empty. |
java.lang.Comparable |
remove()
Remove the smallest value of the structure. |
int |
size()
Determine the size of the priority queue. |
java.lang.String |
toString()
Construct a string representation of the priority vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Vector data
Constructor Detail |
---|
public PriorityVector()
Method Detail |
---|
public java.lang.Comparable getFirst()
getFirst
in interface PriorityQueue
public java.lang.Comparable remove()
remove
in interface PriorityQueue
public void add(java.lang.Comparable value)
add
in interface PriorityQueue
value
- The comparable value to be added.protected int indexOf(java.lang.Comparable target)
public boolean isEmpty()
isEmpty
in interface PriorityQueue
public int size()
size
in interface PriorityQueue
public void clear()
clear
in interface PriorityQueue
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |