|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Queue<E>
Interface for a queue: a collection of elements that are inserted and removed according to the first-in first-out principle.
EmptyQueueException
Method Summary | |
---|---|
E |
dequeue()
Removes the element at the front of the queue. |
void |
enqueue(E element)
Inserts an element at the rear of the queue. |
E |
front()
Inspects the element at the front of the queue. |
boolean |
isEmpty()
Returns whether the queue is empty. |
int |
size()
Returns the number of elements in the queue. |
Method Detail |
---|
int size()
boolean isEmpty()
E front() throws EmptyQueueException
EmptyQueueException
- if the queue is empty.void enqueue(E element)
element
- new element to be inserted.E dequeue() throws EmptyQueueException
EmptyQueueException
- if the queue is empty.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |