|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SimpleQueue<AnyType>
An interface for queues that includes an Iterator. All of these operations should run in O(1) time. Make !NO! changes to this file!
Method Summary | |
---|---|
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 |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
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
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |