org.walluck.util
Class Queue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.walluck.util.Queue
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class Queue
extends Vector

A generic queue class.

Since:
1.0
Version:
1.0
Author:
David Walluck
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Queue()
          Creates a new Queue of the default size.
Queue(int size)
          Creates a new queue of the specified size.
 
Method Summary
 int getMode()
          Get the value of mode.
 Object peek()
          Look at the first object in the queue without removing it.
 Object pop()
          Pop an object off of the queue.
 void push(Object obj)
          Push an object onto the queue.
 void setMode(int mode)
          Set the value of mode.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Queue

public Queue()
Creates a new Queue of the default size.


Queue

public Queue(int size)
Creates a new queue of the specified size.

Parameters:
size - the size of this queue
Method Detail

push

public void push(Object obj)
Push an object onto the queue.

Parameters:
obj - the object

peek

public Object peek()
Look at the first object in the queue without removing it.

Returns:
the first obj of the queue, or null if the queue is empty

pop

public Object pop()
Pop an object off of the queue.

Returns:
the obj that was popped off the queue

getMode

public int getMode()
Get the value of mode.

Returns:
value of mode.

setMode

public void setMode(int mode)
Set the value of mode.

Parameters:
mode - Value to assign to mode.