| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private T[] | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(T o)
Overrides java. Implements java. Appends the specified element to the end of this list (optional operation). |
| public T | get(int i)
Implements abstract java. Implements java. Returns the element at the specified position in this list. |
| private T[] | |
| public T | remove(int i)
Overrides java. Implements java. Removes the element at the specified position in this list (optional operation). |
| public void | |
| public int | size()
Implements abstract java. Implements java. Returns the number of elements in this list. |
| capacity | back to summary |
|---|---|
| private int capacity | |
| head | back to summary |
|---|---|
| private int head | |
| queue | back to summary |
|---|---|
| private T[] queue | |
| tail | back to summary |
|---|---|
| private int tail | |
| ArrayQueue | back to summary |
|---|---|
| public ArrayQueue(int capacity) | |
| add | back to summary |
|---|---|
| public boolean add(T o) Overrides java. Implements java. Doc from java. Appends the specified element to the end of this list (optional operation). Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added. | |
| get | back to summary |
|---|---|
| public T get(int i) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list. | |
| newArray | back to summary |
|---|---|
private T[] newArray(int size)
| |
| remove | back to summary |
|---|---|
| public T remove(int i) Overrides java. Implements java. Doc from java. Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. | |
| resize | back to summary |
|---|---|
| public void resize(int newcapacity) | |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than | |