Class JavaQueue

java.lang.Object
  |
  +--JavaQueue
All Implemented Interfaces:
IQueue

public class JavaQueue
extends Object
implements IQueue

IQueue implementation using a Java Vector to hold its elements.


Field Summary
protected  Vector elements
          Vector used to hold elements.
 
Constructor Summary
JavaQueue()
          Creates a new Java queue.
 
Method Summary
 Object dequeue()
          Removes and returns the front object on this.
 void enqueue(Object anObject)
          Enqueues the given object onto this.
 Object front()
          Returns the front object on this.
 boolean isEmpty()
          Returns whether or not this is empty.
 int size()
          Returns the number of objects on this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

protected Vector elements
Vector used to hold elements.

Constructor Detail

JavaQueue

public JavaQueue()
Creates a new Java queue.

Method Detail

enqueue

public void enqueue(Object anObject)
Enqueues the given object onto this.

Specified by:
enqueue in interface IQueue
Parameters:
anObject - object to enqueue

dequeue

public Object dequeue()
Removes and returns the front object on this.

Specified by:
dequeue in interface IQueue

front

public Object front()
Returns the front object on this.

Specified by:
front in interface IQueue

size

public int size()
Returns the number of objects on this.

Specified by:
size in interface IQueue

isEmpty

public boolean isEmpty()
Returns whether or not this is empty.

Specified by:
isEmpty in interface IQueue