|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Queue<T>
Interface representing a first-in, first-out (FIFO) queue when unsorted, and a priority queue when sorted.
| Nested Class Summary | |
|---|---|
static class |
Queue.QueueListenerList<T>
Queue listener list. |
| Method Summary | |
|---|---|
T |
dequeue()
Removes the item from the head of the queue and returns it. |
void |
enqueue(T item)
Enqueues an item. |
int |
getLength()
Returns the length of the queue. |
ListenerList<QueueListener<T>> |
getQueueListeners()
Returns the queue listener list. |
boolean |
isEmpty()
Tests the emptiness of the queue. |
T |
peek()
Returns the item at the head of the queue without removing it from the queue. |
| Methods inherited from interface org.apache.pivot.collections.Collection |
|---|
clear, getComparator, setComparator |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
void enqueue(T item)
item - The item to add to the queue.T dequeue()
remove(getLength() - 1, 1);
T peek()
boolean isEmpty()
isEmpty in interface Collection<T>int getLength()
ListenerList<QueueListener<T>> getQueueListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||