edu.hawaii.ics.yucheng
Class LinkedListQueue<T>

java.lang.Object
  extended by edu.hawaii.ics.yucheng.LinkedListQueue<T>
Direct Known Subclasses:
JadeSolver.Queue

 class LinkedListQueue<T>
extends java.lang.Object

Implementation of a generic linked list queue. This class exists only to support the JRE 1.5.10, which is currently installed on uhunix2.its.hawaii.edu.


Nested Class Summary
private static class LinkedListQueue.Node<T>
          A node class for the generic queue.
 
Field Summary
private  LinkedListQueue.Node<T> myHead
           
private  LinkedListQueue.Node<T> myTail
           
 
Constructor Summary
LinkedListQueue()
           
 
Method Summary
 boolean isEmpty()
          Returns true if the collection contains no elements.
 T pop()
          Retrieves and removes the head of this queue.
 void push(T e)
          Inserts the specified element into this queue.
 java.lang.String toString()
          Returns the string representation of the class data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myHead

private LinkedListQueue.Node<T> myHead

myTail

private LinkedListQueue.Node<T> myTail
Constructor Detail

LinkedListQueue

LinkedListQueue()
Method Detail

isEmpty

public boolean isEmpty()
Returns true if the collection contains no elements.

Returns:
true if this collection contains no elements

pop

public T pop()
Retrieves and removes the head of this queue.

Returns:
the head of this queue
Throws:
java.util.NoSuchElementException - if this queue is empty

push

public void push(T e)
Inserts the specified element into this queue.

Parameters:
e - the element to add

toString

public java.lang.String toString()
Returns the string representation of the class data.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of the class data.