public class Queue extends java.lang.Object implements java.io.Serializable, RevisionHandler
| Constructor and Description |
|---|
Queue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
empty()
Checks if queue is empty.
|
java.lang.String |
getRevision()
Returns the revision string.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.Object |
peek()
Gets object from the front of the queue.
|
java.lang.Object |
pop()
Pops an object from the front of the queue.
|
java.lang.Object |
push(java.lang.Object item)
Appends an object to the back of the queue.
|
void |
removeAllElements()
Removes all objects from the queue m_Tail.m_Next.
|
int |
size()
Gets queue's size.
|
java.lang.String |
toString()
Produces textual description of queue.
|
public final void removeAllElements()
public java.lang.Object push(java.lang.Object item)
item - the object to be appendedpublic java.lang.Object pop()
throws java.lang.RuntimeException
java.lang.RuntimeException - if the queue is emptypublic java.lang.Object peek()
throws java.lang.RuntimeException
java.lang.RuntimeException - if the queue is emptypublic boolean empty()
public int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlerpublic static void main(java.lang.String[] argv)
argv - a set of strings that are pushed on a test queue