com.aptana.ide.editors.views.profiles
Class ArrayQueue

java.lang.Object
  extended by com.aptana.ide.editors.views.profiles.ArrayQueue
All Implemented Interfaces:
IQueue

public class ArrayQueue
extends java.lang.Object
implements IQueue

Author:
Jason Vowell

Nested Class Summary
 class ArrayQueue.UnderflowException
           
 
Constructor Summary
ArrayQueue()
          Construct the queue.
 
Method Summary
 java.lang.Object dequeue()
          Return and remove the least recently inserted item from the queue.
 void enqueue(java.lang.Object x)
          Insert a new item into the queue.
 java.lang.Object getFront()
          Get the least recently inserted item in the queue.
 boolean isEmpty()
          Test if the queue is logically empty.
 void makeEmpty()
          Make the queue logically empty.
 int size()
          size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayQueue

public ArrayQueue()
Construct the queue.

Method Detail

isEmpty

public boolean isEmpty()
Test if the queue is logically empty.

Specified by:
isEmpty in interface IQueue
Returns:
true if empty, false otherwise.

size

public int size()
Description copied from interface: IQueue
size

Specified by:
size in interface IQueue
Returns:
int
See Also:
IQueue.size()

makeEmpty

public void makeEmpty()
Make the queue logically empty.

Specified by:
makeEmpty in interface IQueue

dequeue

public java.lang.Object dequeue()
Return and remove the least recently inserted item from the queue.

Specified by:
dequeue in interface IQueue
Returns:
the least recently inserted item in the queue.
Throws:
ArrayQueue.UnderflowException - if the queue is empty.

getFront

public java.lang.Object getFront()
Get the least recently inserted item in the queue. Does not alter the queue.

Specified by:
getFront in interface IQueue
Returns:
the least recently inserted item in the queue.
Throws:
ArrayQueue.UnderflowException - if the queue is empty.

enqueue

public void enqueue(java.lang.Object x)
Insert a new item into the queue.

Specified by:
enqueue in interface IQueue
Parameters:
x - the item to insert.