DataStructures
Interface Queue
- All Known Implementing Classes:
- QueueList, QueueArray
- public interface Queue
A first-in-first-out (FIFO) queue of objects.
- Author:
- Peter Williams
|
Method Summary |
java.lang.Object |
dequeue()
Detaches an item from the queue. |
void |
enqueue(java.lang.Object item)
Attaches an item to the queue. |
boolean |
isEmpty()
Indicates the status of the queue. |
isEmpty
public boolean isEmpty()
- Indicates the status of the queue.
- Returns:
true if the queue is empty.
enqueue
public void enqueue(java.lang.Object item)
- Attaches an item to the queue.
- Parameters:
item - the Object to be queued.
dequeue
public java.lang.Object dequeue()
- Detaches an item from the queue.
- Returns:
- the item least recently queued.
- Throws:
NoSuchElementException - if the queue is empty.