Constructor and Description |
---|
ListQueue()
Creates a linked list representing an empty queue.
|
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.
|
public void insert(E x)
Queue
insert
in interface Queue<E>
x
- the object to be pushed onto the queue
public E peek()
Queue
public E remove()
Queue
public boolean isEmpty()
Queue
isEmpty
in interface Queue<E>