edu.UCL.utils
Class Queue

java.lang.Object
  |
  +--edu.UCL.utils.Queue

public class Queue
extends java.lang.Object

Instances of this class represents queues of Object.


Constructor Summary
Queue()
           
 
Method Summary
 void addElement(java.lang.Object element)
          Appends an element to the queue
 void flush()
          Flushes the queue
 java.lang.Object getElement()
          Gets the head of the queue.
 int size()
          Returns the size of the queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
Method Detail

addElement

public void addElement(java.lang.Object element)
Appends an element to the queue

Parameters:
element - The element to be added

getElement

public java.lang.Object getElement()
                            throws java.lang.InterruptedException
Gets the head of the queue.

Returns:
the head of the queue
java.lang.InterruptedException

size

public int size()
Returns the size of the queue

Returns:
the size of the queue

flush

public void flush()
Flushes the queue