structure
Class AbstractQueue

java.lang.Object
  extended by structure.AbstractStructure
      extended by structure.AbstractLinear
          extended by structure.AbstractQueue
All Implemented Interfaces:
Linear, Queue, Structure
Direct Known Subclasses:
QueueArray, QueueList, QueueVector

public abstract class AbstractQueue
extends AbstractLinear
implements Queue

An abstract structure describing a First-In, First-Out structure. Queues are typically used to store the state of a buffered object.


Constructor Summary
AbstractQueue()
           
 
Method Summary
 Object dequeue()
          Remove a value form the head of the queue.
 void enqueue(Object item)
          Add a value to the tail of the queue.
 Object getFirst()
          Fetch the value at the head of the queue.
 Object peek()
          Fetch the value at the head of the queue.
 
Methods inherited from class structure.AbstractLinear
empty, remove
 
Methods inherited from class structure.AbstractStructure
contains, elements, hashCode, isEmpty, values
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface structure.Queue
add, empty, get, remove, size
 
Methods inherited from interface structure.Structure
clear, contains, elements, isEmpty, iterator, remove, values
 

Constructor Detail

AbstractQueue

public AbstractQueue()
Method Detail

enqueue

public void enqueue(Object item)
Add a value to the tail of the queue.

Specified by:
enqueue in interface Queue
Parameters:
value - The value added.

dequeue

public Object dequeue()
Remove a value form the head of the queue.

Specified by:
dequeue in interface Queue
Returns:
The value actually removed.

getFirst

public Object getFirst()
Fetch the value at the head of the queue.

Specified by:
getFirst in interface Queue
Returns:
Reference to the first value of the queue.

peek

public Object peek()
Fetch the value at the head of the queue.

Specified by:
peek in interface Queue
Returns:
Reference to the first value of the queue.