public interface Queue<E>
Modifier and Type | Method and Description |
---|---|
void |
insert(E x)
Inserts a new object onto the queue.
|
boolean |
isEmpty()
Reports whether the queue is currently empty without changing it.
|
E |
peek()
Reports the front element of the queue without changing it.
|
E |
remove()
Removes an element from the front of the stack and reports it.
|
void insert(E x)
x
- the object to be pushed onto the queue
E peek()
java.util.NoSuchElementException
- if the queue is empty
E remove()
java.util.NoSuchElementException
- if the queue is already empty
boolean isEmpty()