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)
Queue
public T remove()
Queue
public T poll()
Queue
public T peek()
Queue
public T peekRear()
public T element()
Queue
public boolean empty()
public int size()