org.bdgp.util
Class Queue

java.lang.Object
  |
  +--org.bdgp.util.Queue

public class Queue
extends java.lang.Object

A run of the mill FIFO queue.


Field Summary
protected  java.util.Vector data
           
 
Constructor Summary
Queue()
          Create a new, empty Queue
Queue(java.util.Vector vector)
          Creates a queue containing the data in the provided Vector
 
Method Summary
 java.lang.Object dequeue()
          Takes a value off the front of the queue
 void enqueue(java.lang.Object object)
          Adds a value to the end of the queue
 boolean isEmpty()
          Indicates whether or not the queue is empty
 java.lang.Object peek()
          Returns the value at the front of the queue
 int size()
          The number of elements in the Queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.Vector data
Constructor Detail

Queue

public Queue()
Create a new, empty Queue

Queue

public Queue(java.util.Vector vector)
Creates a queue containing the data in the provided Vector
Method Detail

enqueue

public void enqueue(java.lang.Object object)
Adds a value to the end of the queue

dequeue

public java.lang.Object dequeue()
Takes a value off the front of the queue

isEmpty

public boolean isEmpty()
Indicates whether or not the queue is empty

size

public int size()
The number of elements in the Queue

peek

public java.lang.Object peek()
Returns the value at the front of the queue