public class Queue extends Object implements Serializable, RevisionHandler
Constructor and Description |
---|
Queue() |
Modifier and Type | Method and Description |
---|---|
boolean |
empty()
Checks if queue is empty.
|
String |
getRevision()
Returns the revision string.
|
static void |
main(String[] argv)
Main method for testing this class.
|
Object |
peek()
Gets object from the front of the queue.
|
Object |
pop()
Pops an object from the front of the queue.
|
Object |
push(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.
|
String |
toString()
Produces textual description of queue.
|
public final void removeAllElements()
public Object push(Object item)
item
- the object to be appendedpublic Object pop() throws RuntimeException
RuntimeException
- if the queue is emptypublic Object peek() throws RuntimeException
RuntimeException
- if the queue is emptypublic boolean empty()
public int size()
public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
public static void main(String[] argv)
argv
- a set of strings that are pushed on a test queueCopyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.