|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.QueueList
Defines a queue based on a SentinelDLL
.
Field Summary | |
private com.mhhe.clrs2e.SentinelDLL |
list
The list implementing the queue. |
Constructor Summary | |
QueueList()
Makes an empty queue. |
Method Summary | |
java.lang.Object |
dequeue()
Removes an element from the head of the queue. |
java.lang.Object |
enqueue(java.lang.Object o)
Inserts an element at the tail of the queue. |
boolean |
isEmpty()
Returns true if the list is empty (containing
only its sentinel), and false otherwise. |
java.lang.String |
toString()
Returns the String representation of this
queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private com.mhhe.clrs2e.SentinelDLL list
Constructor Detail |
public QueueList()
Method Detail |
public java.lang.Object enqueue(java.lang.Object o)
o
- The element inserted.
public java.lang.Object dequeue()
java.lang.IllegalStateException
- if the queue is empty at the time
of the call.public boolean isEmpty()
true
if the list is empty (containing
only its sentinel), and false
otherwise.
public java.lang.String toString()
String
representation of this
queue.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |