Class VectorQueue

java.lang.Object
  |
  +--VectorQueue
All Implemented Interfaces:
QueueInterface

public class VectorQueue
extends java.lang.Object
implements QueueInterface

Queue implementation using a Vector as its underlying data structure.


Field Summary
protected  java.util.Vector elements
          The vector used for storage.
 
Constructor Summary
VectorQueue()
           
 
Method Summary
 java.lang.Object dequeue()
          Dequeues and returns the next available element on this queue.
 void enqueue(java.lang.Object element)
          Enqueues the given element on this queue.
 java.lang.Object front()
          Returns the next available element on this queue.
 boolean isEmpty()
          Returns whether or not this queue structure is empty.
 int size()
          Returns the size of this queue structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

protected java.util.Vector elements
The vector used for storage.
Constructor Detail

VectorQueue

public VectorQueue()
Method Detail

dequeue

public java.lang.Object dequeue()
Description copied from interface: QueueInterface
Dequeues and returns the next available element on this queue.
Specified by:
dequeue in interface QueueInterface

enqueue

public void enqueue(java.lang.Object element)
Description copied from interface: QueueInterface
Enqueues the given element on this queue.
Specified by:
enqueue in interface QueueInterface
Following copied from interface: QueueInterface
Parameters:
element - the desired element to enqueue

isEmpty

public boolean isEmpty()
Description copied from interface: QueueInterface
Returns whether or not this queue structure is empty.
Specified by:
isEmpty in interface QueueInterface

front

public java.lang.Object front()
Description copied from interface: QueueInterface
Returns the next available element on this queue.
Specified by:
front in interface QueueInterface

size

public int size()
Description copied from interface: QueueInterface
Returns the size of this queue structure.
Specified by:
size in interface QueueInterface