pop() for stack operation)
is backed by a growable circular array.
| Modifier and Type | Field and Description |
|---|---|
| private Object[] | |
| private int | |
| private Object | |
| private int | |
| private int | |
| private int | |
| public final int | |
| public final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(E
the element to add e)Overrides java. Implements java. true upon success and throwing an IllegalStateException
if no space is currently available.
|
| public void | add(int
index at which the specified element is to be inserted index, E element to be inserted element)Overrides java. Implements java. |
| public void | |
| public void | clear()
Overrides java. Implements java. |
| public E | element()
Implements java. |
| public E | get(int
index of the element to return index)Implements abstract java. Implements java. |
| public int | |
| public E | |
| protected void | |
| public boolean | isEmpty()
Overrides java. Implements java. true if this collection contains no elements.
|
| public boolean | offer(E
the element to add e)Implements java. |
| public E | peek()
Implements java. null if this queue is empty.
|
| public E | poll()
Implements java. null if this queue is empty.
|
| public E | |
| public E | remove(int
the index of the element to be removed index)Overrides java. Implements java. |
| public E | set(int
index of the element to replace index, E element to be stored at the specified position element)Overrides java. Implements java. |
| public int | size()
Implements abstract java. Implements java. |
| _elements | back to summary |
|---|---|
| private Object[] _elements | |
| _growCapacity | back to summary |
|---|---|
| private int _growCapacity | |
| _lock | back to summary |
|---|---|
| private Object _lock | |
| _nextE | back to summary |
|---|---|
| private int _nextE | |
| _nextSlot | back to summary |
|---|---|
| private int _nextSlot | |
| _size | back to summary |
|---|---|
| private int _size | |
| DEFAULT_CAPACITY | back to summary |
|---|---|
| public final int DEFAULT_CAPACITY | |
| DEFAULT_GROWTH | back to summary |
|---|---|
| public final int DEFAULT_GROWTH | |
| ArrayQueue | back to summary |
|---|---|
| public ArrayQueue() | |
| ArrayQueue | back to summary |
|---|---|
| public ArrayQueue(int capacity) | |
| ArrayQueue | back to summary |
|---|---|
| public ArrayQueue(int initCapacity, int growBy) | |
| ArrayQueue | back to summary |
|---|---|
| public ArrayQueue(int initCapacity, int growBy, Object lock) | |
| add | back to summary |
|---|---|
| public boolean add(E e) Overrides java. Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
| |
| add | back to summary |
|---|---|
| public void add(int index, E element) Overrides java. Implements java. Doc from java. Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
| |
| addUnsafe | back to summary |
|---|---|
| public void addUnsafe(E e) add without synchronization or bounds checking
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides java. Implements java. Doc from java. Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns. | |
| element | back to summary |
|---|---|
| public E element() Implements java. Doc from java. Retrieves, but does not remove, the head of this queue. This method
differs from
| |
| get | back to summary |
|---|---|
| public E get(int index) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| getCapacity | back to summary |
|---|---|
| public int getCapacity() | |
| getUnsafe | back to summary |
|---|---|
| public E getUnsafe(int index) Get without synchronization or bounds checking.
| |
| grow | back to summary |
|---|---|
| protected void grow() | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides java. Implements java. Doc from java. Returns
| |
| offer | back to summary |
|---|---|
| public boolean offer(E e) Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
When using a capacity-restricted queue, this method is generally
preferable to
| |
| peek | back to summary |
|---|---|
| public E peek() Implements java. Doc from java. Retrieves, but does not remove, the head of this queue,
or returns
| |
| poll | back to summary |
|---|---|
| public E poll() Implements java. Doc from java. Retrieves and removes the head of this queue,
or returns
| |
| remove | back to summary |
|---|---|
| public E remove() Implements java. Doc from java. Retrieves and removes the head of this queue. This method differs
from
| |
| remove | back to summary |
|---|---|
| public E remove(int index) 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.
| |
| set | back to summary |
|---|---|
| public E set(int index, E element) Overrides java. Implements java. Doc from java. Replaces the element at the specified position in this list with the specified element (optional operation).
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this collection. If this collection
contains more than
| |