netcom.log
Class QueueAr

java.lang.Object
  extended bynetcom.log.QueueAr

public class QueueAr
extends java.lang.Object

This class was made availible in DataStructures... NETCOM does not claim any responsibility of this class Array-based implementation of the queue.


Constructor Summary
QueueAr()
          Construct the queue.
QueueAr(int capacity)
          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.
 boolean isFull()
          Test if the queue is logically full.
 void makeEmpty()
          Make the queue logically empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueAr

public QueueAr()
Construct the queue.


QueueAr

public QueueAr(int capacity)
Construct the queue.

Method Detail

isEmpty

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

Returns:
true if empty, false otherwise.

isFull

public boolean isFull()
Test if the queue is logically full.

Returns:
true if full, false otherwise.

makeEmpty

public void makeEmpty()
Make the queue logically empty.


getFront

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

Returns:
the least recently inserted item in the queue, or null, if empty.

dequeue

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

Returns:
the least recently inserted item in the queue, or null, if empty.

enqueue

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

Parameters:
x - the item to insert.
Throws:
Overflow - if queue is full.