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

brutil
Class AbstractQueue

java.lang.Object
  |
  +--brutil.AbstractListing
        |
        +--brutil.AbstractQueue
All Implemented Interfaces:
Collection, Queue
Direct Known Subclasses:
ArrayQueue, LinkedQueue

public abstract class AbstractQueue
extends AbstractListing
implements Queue


Fields inherited from class brutil.AbstractListing
list
 
Constructor Summary
AbstractQueue()
           
 
Method Summary
 java.lang.Object dequeue()
          Remove an object from the front of the Queue.
 void enqueue(java.lang.Object elt)
          Add an object to the back of the Queue.
 java.lang.Object peek()
          Returns the first object in the Queue without removing it.
 
Methods inherited from class brutil.AbstractListing
clear, isEmpty, listFactory, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface brutil.Queue
isEmpty
 
Methods inherited from interface brutil.Collection
clear, size
 

Constructor Detail

AbstractQueue

public AbstractQueue()
Method Detail

enqueue

public void enqueue(java.lang.Object elt)
Add an object to the back of the Queue.
Specified by:
enqueue in interface Queue
Parameters:
elt - The object to be added.

dequeue

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

peek

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


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