|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectMysteryQueueImplementation<T>
T - The type of data that the queue stores.public class MysteryQueueImplementation<T>
An implementation of the Queue ADT.
| Constructor Summary | |
|---|---|
MysteryQueueImplementation()
Default constructor for an empty queue. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all items from the queue. |
T |
dequeue()
Removes an item from the front of the queue and returns it. |
void |
enqueue(T item)
Adds the given item to the back of the queue. |
boolean |
isEmpty()
Returns true if the queue is empty. |
static void |
main(java.lang.String[] args)
|
T |
peek()
Returns the item at the front of the queue, without removing it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MysteryQueueImplementation()
| Method Detail |
|---|
public void enqueue(T item)
Queue
enqueue in interface Queue<T>item - the item to addpublic T dequeue()
Queue
dequeue in interface Queue<T>public T peek()
Queue
peek in interface Queue<T>public boolean isEmpty()
Queue
isEmpty in interface Queue<T>public void clear()
Queue
clear in interface Queue<T>public static void main(java.lang.String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||