public interface QueueADT<E>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all items in the queue leaving an empty queue.
|
E |
dequeue()
Removes an item from the front of the Queue and returns it.
|
void |
enqueue(E item)
Adds an item to the rear of the queue.
|
boolean |
isEmpty()
Returns true iff the Queue is empty.
|
E |
peek()
Returns the item at front of the Queue without removing it.
|
int |
size()
Returns the number of items in the Queue.
|
void enqueue(E item)
item
- the item to add to the queue.java.lang.IllegalArgumentException
- if item is null.E dequeue()
EmptyQueueException
- if the queue is empty.E peek()
EmptyQueueException
- if the queue is empty.boolean isEmpty()
void clear()
int size()