| Constructor and Description |
|---|
AQueue()
This default constructor initializes the internal array to the size of 10.
|
AQueue(int capacity)
This constructor initializes the internal array to the size specified by
capacity.
|
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
T |
element()
Peek at the first item at the front end.
|
boolean |
empty() |
boolean |
offer(T item)
Offer the item into this Queue at the rear end.
|
T |
peek()
Peek at the first item at the front end.
|
T |
peekRear() |
T |
poll()
Remove the item at the front end.
|
T |
remove()
Remove the item from the Queue at the front end.
|
int |
size() |
public AQueue()
public AQueue(int capacity)
capacity - is the maximum number of items this queue can store.public boolean offer(T item)
Queuepublic T remove()
Queuepublic T poll()
Queuepublic T peek()
Queuepublic T peekRear()
public T element()
Queuepublic boolean empty()
public int size()