redblacktreeproject
Class Queue

java.lang.Object
  extended by redblacktreeproject.Queue

public class Queue
extends java.lang.Object


Constructor Summary
Queue()
          Create an empty queue.
 
Method Summary
 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.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
Create an empty queue.

Method Detail

isEmpty

public boolean isEmpty()
Boolean method returns true on empty queue, false otherwise.

Returns:
Returns true if queue is empty.

deQueue

public java.lang.Object deQueue()
Object method removes and returns reference in front of queue.

Returns:
object in front of queue.

enQueue

public void enQueue(java.lang.Object x)
Add an object reference to the rear of the queue.

Parameters:
x - is an object to be added to the rear of the queue.

getFront

public java.lang.Object getFront()
Method getFront returns the front of the queue without removing it.

Returns:
the queue front without removal.

toString

public java.lang.String toString()
The toString method returns a String representation of the current queue contents.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the queue.

main

public static void main(java.lang.String[] a)
main is for testing the queue routines.

Parameters:
a - Command line parameters are not used.