|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsint.Queue
public class Queue
A queue, q, is a Pair (cons ,last ,content), see Peter's, PAIP book.
This lets .add() be written without a null comparison, but uses an extra Pair.
Used by InputPort.readTail and U.append.
Constructor Summary | |
---|---|
Queue()
Create an empty Queue. |
|
Queue(java.lang.Object item)
Create a Queue containing the single element, item. |
Method Summary | |
---|---|
Queue |
add(java.lang.Object item)
Add an item to the end of the Queue. |
java.lang.Object |
front()
Return the first item in the Queue, or null if the Queue is empty. |
java.lang.Object |
getContent()
Get the Queue's content as a Pair list. |
Pair |
getLast()
Get the last Pair of the Queue's content. |
java.lang.Object |
pop()
|
Queue |
remove()
Remove an item from the front of the Queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Queue()
public Queue(java.lang.Object item)
Method Detail |
---|
public Pair getLast()
public java.lang.Object getContent()
public Queue add(java.lang.Object item)
public Queue remove()
public java.lang.Object front()
public java.lang.Object pop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |