|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectQueue<E>
E - The parameter of the Queue.public class Queue<E>
Implements a queue data structure. Elements are added to the end of the queue but removed from the front.
| Constructor Summary | |
|---|---|
Queue()
Creates a new, empty queue. |
|
| Method Summary | |
|---|---|
E |
dequeue()
Removes an element to the queue. |
boolean |
enqueue(E element)
Adds an element to the queue. |
boolean |
isEmpty()
This method tells whether the queue is empty or not. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public boolean enqueue(E element)
element - The element to be added.
public E dequeue()
Throws - a NoSuchElementException if the queue is empty.public boolean isEmpty()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||