All Packages Class Hierarchy This Package Previous Next Index
Class DataStructures.QueueAr
java.lang.Object
|
+----DataStructures.QueueAr
- public class QueueAr
- extends Object
Array-based implementation of the queue.
QueueAr()
- Construct the queue.
QueueAr(int)
- Construct the queue.
dequeue()
- Return and remove the least recently inserted item from the queue.
enqueue(Object)
- Insert a new item into the queue.
getFront()
- Get the least recently inserted item in the queue.
isEmpty()
- Test if the queue is logically empty.
isFull()
- Test if the queue is logically full.
main(String[])
-
makeEmpty()
- Make the queue logically empty.
QueueAr
public QueueAr()
- Construct the queue.
QueueAr
public QueueAr(int capacity)
- Construct the queue.
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 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 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(Object x) throws Overflow
- Insert a new item into the queue.
- Parameters:
- x - the item to insert.
- Throws:
Overflow
- if queue is full.
main
public static void main(String[] args)
All Packages Class Hierarchy This Package Previous Next Index