public interface QueueADT<T>
Modifier and Type | Method and Description |
---|---|
T |
dequeue()
Return and remove the next item (from the front) of the queue,
If queue is empty, throw EmptyQueueException
|
T |
element()
Get and do not remove the next item in the queue,
If queue is empty, throw EmptyQueueException
|
void |
enqueue(T data)
Add data to the rear of the Queue,
|
boolean |
isEmpty()
Return true iff if the Queue is empty
|
boolean isEmpty()
void enqueue(T data) throws java.lang.IllegalArgumentException
data
- the data item to add to end of queuejava.lang.IllegalArgumentException
- when data is nullT dequeue() throws EmptyQueueException
EmptyQueueException
T element() throws EmptyQueueException
EmptyQueueException
- if there are no items in the queue