All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class DataStructures.QueueLi

java.lang.Object
    |
    +----DataStructures.QueueLi

public class QueueLi
extends Object
implements Queue
List-based implementation of the queue.


Constructor Index

 o QueueLi()
Construct the queue.

Method Index

 o dequeue()
Return and remove the least recently inserted item from the queue.
 o enqueue(Object)
Insert a new item into the queue.
 o getFront()
Get the least recently inserted item in the queue.
 o isEmpty()
Test if the queue is logically empty.
 o makeEmpty()
Make the queue logically empty.

Constructors

 o QueueLi
public QueueLi()
Construct the queue.

Methods

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

Returns:
true if empty, false otherwise.
 o makeEmpty
public void makeEmpty()
Make the queue logically empty.

 o getFront
public Object getFront() throws Underflow
Get the least recently inserted item in the queue. Does not alter the queue.

Returns:
the least recently inserted item in the queue.
Throws: Underflow
if the queue is empty.
 o dequeue
public Object dequeue() throws Underflow
Return and remove the least recently inserted item from the queue.

Returns:
the least recently inserted item in the queue.
Throws: Underflow
if the queue is empty.
 o enqueue
public void enqueue(Object x)
Insert a new item into the queue.

Parameters:
x - the item to insert.

All Packages  Class Hierarchy  This Package  Previous  Next  Index