public class BoundedQueue<E> extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<E> |
elements |
private int |
head |
private int |
size |
private int |
tail |
Constructor and Description |
---|
BoundedQueue(int capacity)
Constructs an empty queue.
|
Modifier and Type | Method and Description |
---|---|
void |
add(E newValue)
Appends an object at the tail.
|
E |
remove()
Removes the object at the head.
|
public BoundedQueue(int capacity)
capacity
- the maximum capacity of the queue