Interface FIFOQueue

All Known Implementing Classes:
DynamicHeap

public interface FIFOQueue

Generic FIFO queue.


Method Summary
 java.lang.Object dequeueFIFO()
          Removes the item that was inserted first into this queue, and returns this item.
 int getSize()
          Returns the current size (number of items) in this queue.
 java.lang.Object headFIFO()
          Returns the item that was inserted first into this queue.
 

Method Detail

headFIFO

public java.lang.Object headFIFO()
Returns the item that was inserted first into this queue. Precondition: this queue is not empty

Returns:
the first item in this queue
Throws:
java.lang.IndexOutOfBoundsException - if this queue is empty

dequeueFIFO

public java.lang.Object dequeueFIFO()
Removes the item that was inserted first into this queue, and returns this item. Precondition: this queue is not empty

Returns:
the first item in this queue
Throws:
java.lang.IndexOutOfBoundsException - if this queue is empty

getSize

public int getSize()
Returns the current size (number of items) in this queue.

Returns:
the current size (number of items) in this queue