|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectstructure.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| Constructor Summary | |
|---|---|
PriorityVector()
Construct an empty priority queue. |
|
| Method Summary | |
|---|---|
void |
add(Comparable value)
Add a comparable value to the priority queue. |
void |
clear()
Remove all the values from the priority queue. |
Comparable |
getFirst()
Fetch the smallest value of the priority queue. |
boolean |
isEmpty()
Determine if the priority queue is empty. |
Comparable |
remove()
Remove the smallest value of the structure. |
int |
size()
Determine the size of the priority queue. |
String |
toString()
Construct a string representation of the priority vector. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PriorityVector()
| Method Detail |
|---|
public Comparable getFirst()
getFirst in interface PriorityQueuepublic Comparable remove()
remove in interface PriorityQueuepublic void add(Comparable value)
add in interface PriorityQueuevalue - The comparable value to be added.public boolean isEmpty()
isEmpty in interface PriorityQueuepublic int size()
size in interface PriorityQueuepublic void clear()
clear in interface PriorityQueuepublic String toString()
toString in class Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||