BRUtil - Making Java a Kinder, Gentler, Place to be.

brutil
Interface Queue

All Superinterfaces:
Collection
All Known Implementing Classes:
AbstractQueue

public interface Queue
extends Collection


Method Summary
 java.lang.Object dequeue()
          Remove an object from the front of the Queue.
 void enqueue(java.lang.Object o)
          Add an object to the back of the Queue.
 boolean isEmpty()
          Returns true if the Collection contains no elements, false otherwise
 java.lang.Object peek()
          Returns the first object in the Queue without removing it.
 
Methods inherited from interface brutil.Collection
clear, size
 

Method Detail

enqueue

public void enqueue(java.lang.Object o)
Add an object to the back of the Queue.
Parameters:
o - The object to be added.

dequeue

public java.lang.Object dequeue()
Remove an object from the front of the Queue.
Returns:
The object taken out of the Queue.
Throws:
java.util.NoSuchElementException - if this Queue is Empty.

isEmpty

public boolean isEmpty()
Description copied from interface: Collection
Returns true if the Collection contains no elements, false otherwise
Specified by:
isEmpty in interface Collection
Returns:
true if the Queue is empty, false otherwise.

peek

public java.lang.Object peek()
Returns the first object in the Queue without removing it.
Returns:
The first object in the Queue
Throws:
java.util.NoSuchElementException - if this Queue is Empty


BRUtil - Making Java a Kinder, Gentler, Place to be.