public interface SimpleQueue<AnyType>
extends java.lang.Iterable<AnyType>
Modifier and Type | Method and Description |
---|---|
AnyType |
dequeue()
Retrieves and removes the first element of the queue
|
void |
enqueue(AnyType value)
Inserts an element at the end of the queue
|
boolean |
isEmpty()
Determines if the queue has no elements
|
AnyType |
peek()
Retrieves, but does not remove, the first element of the queue
|
boolean isEmpty()
true
if the queue is empty; false
otherwisevoid enqueue(AnyType value)
value
- the element to be inserted into the queueAnyType dequeue()
null
if the queue is emptyAnyType peek()
null
if the queue is empty