Class LLQueue
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.AbstractSequentialList
|
+--java.util.LinkedList
|
+--LLQueue
- All Implemented Interfaces:
- Cloneable, Collection, List, Serializable
- public class LLQueue
- extends LinkedList
LLQueue.java
A queue implementation that extends java.util.LinkedList
Created: Tue Mar 25 13:24:26 2003
- Author:
- Stuart C. Shapiro
- See Also:
- Serialized Form
Constructor Summary |
LLQueue()
Creates a new LLQueue instance. |
Method Summary |
Object |
dequeue()
Removes the Object that is at the front of this
queue, and returns it. |
void |
enqueue(Object obj)
Adds an Object to the rear of this queue. |
Object |
front()
Returns the first element on this queue. |
Methods inherited from class java.util.LinkedList |
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
LLQueue
public LLQueue()
- Creates a new
LLQueue
instance.
front
public Object front()
throws NoSuchElementException
- Returns the first element on this queue.
- Returns:
- the first
Object
on the queue.
- Throws:
NoSuchElementException
- if this queue is empty.
enqueue
public void enqueue(Object obj)
- Adds an
Object
to the rear of this queue.
- Parameters:
obj
- the Object
to be added to this queue.
dequeue
public Object dequeue()
throws NoSuchElementException
- Removes the
Object
that is at the front of this
queue, and returns it.
- Returns:
- the
Object
at the front of this queue,
having removed it from this queue.
- Throws:
NoSuchElementException
- if this queue is empty.