SimObs
Class Queue

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--SimObs.Queue

public class Queue
extends java.util.Vector

Simple class that extends Vector so as to model queues.

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Queue()
          Constructor, just sets the two data fields to zero.
 
Method Summary
 void addToTail(java.lang.Object thisObject)
          Puts the object on the tail of the queue.
 int getNumAdded()
          Returns with the number added to the queue so far.
 int getNumRemoved()
          Returns with the number removed from the queue so far.
 void show()
          Writes the queue contents to tracefile.
 java.lang.Object takeFromHead()
          Returns with the object currently at the head of the queue.
 java.lang.Object takeFromTail()
          Returns with the object currently at the tail of the queue.
 
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
 

Constructor Detail

Queue

public Queue()
Constructor, just sets the two data fields to zero.
Method Detail

addToTail

public void addToTail(java.lang.Object thisObject)
Puts the object on the tail of the queue. Updates numAdded.

takeFromHead

public java.lang.Object takeFromHead()
Returns with the object currently at the head of the queue. Throws a fatal error if the queue is empty.

takeFromTail

public java.lang.Object takeFromTail()
Returns with the object currently at the tail of the queue. Throws a fatal error if the queue is empty.

getNumAdded

public int getNumAdded()
Returns with the number added to the queue so far.

getNumRemoved

public int getNumRemoved()
Returns with the number removed from the queue so far.

show

public void show()
Writes the queue contents to tracefile.