public class Queue
extends java.lang.Object
Constructor and Description |
---|
Queue()
Create an empty queue that lives in a small array.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deQueue()
Object method removes and returns reference in front of queue.
|
void |
enQueue(java.lang.Object x)
Add an object reference to the rear of the queue.
|
java.lang.Object |
getFront()
Method getFront returns the front of the queue without
removing it.
|
boolean |
isEmpty()
Boolean method returns true on empty queue, false otherwise.
|
boolean |
isFull()
Boolean method returns true if queue is currently at capacity, false otherwise.
|
static void |
main(java.lang.String[] a)
main is for testing the queue routines.
|
java.lang.String |
toString()
The toString method returns a String representation
of the current queue contents.
|
public Queue()
public boolean isEmpty()
public boolean isFull()
public java.lang.Object deQueue()
public void enQueue(java.lang.Object x)
x
- is an object to be added to the rear of the queue.public java.lang.Object getFront()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] a)
a
- Command line parameters are not used.