This is a classic "bounded buffer", in which a
fixed-sized array holds elements inserted by producers and
extracted by consumers. Once created, the capacity cannot be
changed. Attempts to put an element into a full queue
will result in the operation blocking; attempts to take an
element from an empty queue will similarly block.
This class supports an optional fairness policy for ordering
waiting producer and consumer threads. By default, this ordering
is not guaranteed. However, a queue constructed with fairness set
to true grants threads access in FIFO order. Fairness
generally decreases throughput but reduces variability and avoids
starvation.
This class and its iterator implement all of the optional
methods of the Collection and Iterator interfaces.
This class is a member of the Java Collections Framework.
| Modifier and Type | Class and Description |
|---|---|
| private class | ArrayBlockingQueue.
Iterator for ArrayBlockingQueue. |
| pack-priv class | ArrayBlockingQueue.
Shared data between iterators and their queue, allowing queue modifications to update iterators when elements are removed. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv final Object[] | |
| pack-priv transient ArrayBlockingQueue | itrs
Shared state for currently active iterators, or null if there are known not to be any. |
| pack-priv final ReentrantLock | |
| private final Condition | |
| private final Condition | |
| pack-priv int | |
| private static final long | serialVersionUID
Serialization ID. This class relies on default serialization even for the items array, which is default-serialized, even if it is empty. |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | ArrayBlockingQueue(int
the capacity of this queue capacity)Creates an |
| public | ArrayBlockingQueue(int
the capacity of this queue capacity, boolean if fair)true then queue accesses for threads blocked
on insertion or removal, are processed in FIFO order;
if false the access order is unspecified.Creates an |
| public | ArrayBlockingQueue(int
the capacity of this queue capacity, boolean if fair, Collection<? extends E> true then queue accesses for threads blocked
on insertion or removal, are processed in FIFO order;
if false the access order is unspecified.the collection of elements to initially contain c)Creates an |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(E
the element to add e)Overrides java. Implements java. Inserts the specified element at the tail of this queue if it is
possible to do so immediately without exceeding the queue's capacity,
returning |
| private boolean | |
| private boolean | bulkRemoveModified(Predicate<? super E> filter, final int
valid index of first element to be deleted beg)Helper for bulkRemove, in case of at least one deletion. |
| pack-priv void | |
| private static void | circularClear(Object[] items, int i, int end)
Nulls out slots starting at array index i, up to index end. |
| public void | clear()
Overrides java. Implements java. Atomically removes all of the elements from this queue. |
| public boolean | Returns: true if this queue contains the specified elementobject to be checked for containment in this queue o)Overrides java. Implements java. Returns |
| pack-priv static final int | |
| private E | |
| private int | distanceNonEmpty(int i, int j)
Returns circular distance from i to j, disambiguating i == j to items.length; never returns 0. |
| public int | drainTo(Collection<? super E> c)
Implements java. Removes all available elements from this queue and adds them to the given collection. |
| public int | drainTo(Collection<? super E> c, int maxElements)
Implements java. Removes at most the given number of available elements from this queue and adds them to the given collection. |
| private void | |
| public void | forEach(Consumer<? super E> action)
Overrides default java. Performs the given action for each element of the |
| pack-priv static final int | |
| private boolean | |
| private static boolean | |
| pack-priv final E | |
| pack-priv static <E> E | |
| public Iterator | Returns: an iterator over the elements in this queue in proper sequenceImplements abstract java. Implements java. Returns an iterator over the elements in this queue in proper sequence. |
| private static long[] | |
| public boolean | offer(E e)
Implements java. Inserts the specified element at the tail of this queue if it is
possible to do so immediately without exceeding the queue's capacity,
returning |
| public boolean | offer(E e, long timeout, TimeUnit unit)
Implements java. Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full. |
| public E | peek()
Implements java. Retrieves, but does not remove, the head of this queue,
or returns |
| public E | poll()
Implements java. Retrieves and removes the head of this queue,
or returns |
| public E | poll(long timeout, TimeUnit unit)
Implements java. Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available. |
| public void | put(E e)
Implements java. Inserts the specified element at the tail of this queue, waiting for space to become available if the queue is full. |
| private void | readObject(ObjectInputStream
the stream s)Reconstitutes this queue from a stream (that is, deserializes it). |
| public int | remainingCapacity()
Implements java. Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking. |
| public boolean | Returns: true if this queue changed as a result of the callelement to be removed from this queue, if present o)Overrides java. Implements java. Removes a single instance of the specified element from this queue, if it is present. |
| public boolean | removeAll(Collection<?> c)
Overrides java. Implements java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). |
| pack-priv void | |
| public boolean | removeIf(Predicate<? super E> filter)
Overrides default java. Removes all of the elements of this collection that satisfy the given predicate (optional operation). |
| public boolean | retainAll(Collection<?> c)
Overrides java. Implements java. Retains only the elements in this collection that are contained in the specified collection (optional operation). |
| private static void | |
| public int | Returns: the number of elements in this queueImplements abstract java. Implements java. Returns the number of elements in this queue. |
| public Spliterator | Returns: aSpliterator over the elements in this queueOverrides default java. Returns a |
| public E | take()
Implements java. Retrieves and removes the head of this queue, waiting if necessary until an element becomes available. |
| public Object[] | Returns: an array containing all of the elements in this queueOverrides java. Implements java. Returns an array containing all of the elements in this queue, in proper sequence. |
| public <T> T[] | Returns: an array containing all of the elements in this queuethe array into which the elements of the queue are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose a)Overrides java. Implements java. Returns an array containing all of the elements in this queue, in proper sequence; the runtime type of the returned array is that of the specified array. |
| public String | toString()
Overrides java. Returns a string representation of this collection. |
| private void | writeObject(ObjectOutputStream
the stream s)Writes the queue to the stream whilst holding the locks to prevent broken invariants. |
| count | back to summary |
|---|---|
| pack-priv int count | |
| items | back to summary |
|---|---|
pack-priv final Object[] items
| |
| itrs | back to summary |
|---|---|
| pack-priv transient ArrayBlockingQueue<E>. Shared state for currently active iterators, or null if there are known not to be any. Allows queue operations to update iterator state. | |
| lock | back to summary |
|---|---|
| pack-priv final ReentrantLock lock | |
| notEmpty | back to summary |
|---|---|
private final Condition notEmpty
| |
| notFull | back to summary |
|---|---|
private final Condition notFull
| |
| putIndex | back to summary |
|---|---|
| pack-priv int putIndex | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization ID. This class relies on default serialization even for the items array, which is default-serialized, even if it is empty. Otherwise it could not be declared final, which is necessary here. | |
| takeIndex | back to summary |
|---|---|
| pack-priv int takeIndex | |
| ArrayBlockingQueue | back to summary |
|---|---|
| public ArrayBlockingQueue(int capacity) Creates an
| |
| ArrayBlockingQueue | back to summary |
|---|---|
| public ArrayBlockingQueue(int capacity, boolean fair) Creates an
| |
| ArrayBlockingQueue | back to summary |
|---|---|
| public ArrayBlockingQueue(int capacity, boolean fair, Collection<? extends E> c) Creates an
| |
| add | back to summary |
|---|---|
| public boolean add(E e) Overrides java. Implements java. Inserts the specified element at the tail of this queue if it is
possible to do so immediately without exceeding the queue's capacity,
returning
| |
| bulkRemove | back to summary |
|---|---|
| private boolean bulkRemove(Predicate<? super E> filter) Implementation of bulk remove methods. | |
| bulkRemoveModified | back to summary |
|---|---|
| private boolean bulkRemoveModified(Predicate<? super E> filter, final int beg) Helper for bulkRemove, in case of at least one deletion. Tolerate predicates that reentrantly access the collection for read (but not write), so traverse once to find elements to delete, a second pass to physically expunge.
| |
| checkInvariants | back to summary |
|---|---|
| pack-priv void checkInvariants() debugging | |
| circularClear | back to summary |
|---|---|
| private static void circularClear(Object[] items, int i, int end) Nulls out slots starting at array index i, up to index end. Condition i == end means "full" - the entire array is cleared. | |
| clear | back to summary |
|---|---|
| public void clear() Overrides java. Implements java. Atomically removes all of the elements from this queue. The queue will be empty after this call returns. | |
| contains | back to summary |
|---|---|
| public boolean contains(Object o) Overrides java. Implements java. Returns
| |
| dec | back to summary |
|---|---|
| pack-priv static final int dec(int i, int modulus) Decrements i, mod modulus. Precondition and postcondition: 0 <= i < modulus. | |
| dequeue | back to summary |
|---|---|
| private E dequeue() Extracts element at current take position, advances, and signals. Call only when holding lock. | |
| distanceNonEmpty | back to summary |
|---|---|
| private int distanceNonEmpty(int i, int j) Returns circular distance from i to j, disambiguating i == j to items.length; never returns 0. | |
| drainTo | back to summary |
|---|---|
| public int drainTo(Collection<? super E> c) Implements java. Doc from java. Removes all available elements from this queue and adds them
to the given collection. This operation may be more
efficient than repeatedly polling this queue. A failure
encountered while attempting to add elements to
collection
| |
| drainTo | back to summary |
|---|---|
| public int drainTo(Collection<? super E> c, int maxElements) Implements java. Doc from java. Removes at most the given number of available elements from
this queue and adds them to the given collection. A failure
encountered while attempting to add elements to
collection
| |
| enqueue | back to summary |
|---|---|
| private void enqueue(E e) Inserts element at current put position, advances, and signals. Call only when holding lock. | |
| forEach | back to summary |
|---|---|
| public void forEach(Consumer<? super E> action) Overrides default java. Doc from java. Performs the given action for each element of the The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.
| |
| inc | back to summary |
|---|---|
| pack-priv static final int inc(int i, int modulus) Increments i, mod modulus. Precondition and postcondition: 0 <= i < modulus. | |
| invariantsSatisfied | back to summary |
|---|---|
| private boolean invariantsSatisfied() | |
| isClear | back to summary |
|---|---|
| private static boolean isClear(long[] bits, int i) | |
| itemAt | back to summary |
|---|---|
| pack-priv final E itemAt(int i) Returns item at index i.
| |
| itemAt | back to summary |
|---|---|
| pack-priv static <E> E itemAt(Object[] items, int i) Returns element at array index i. This is a slight abuse of generics, accepted by javac.
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements abstract java. Implements java. Returns an iterator over the elements in this queue in proper sequence. The elements will be returned in order from first (head) to last (tail). The returned iterator is weakly consistent.
| |
| nBits | back to summary |
|---|---|
| private static long[] nBits(int n) | |
| offer | back to summary |
|---|---|
| public boolean offer(E e) Implements java. Inserts the specified element at the tail of this queue if it is
possible to do so immediately without exceeding the queue's capacity,
returning
| |
| offer | back to summary |
|---|---|
| public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException Implements java. Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full.
| |
| 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 | |
| poll | back to summary |
|---|---|
| public E poll(long timeout, TimeUnit unit) throws InterruptedException Implements java. Doc from java. Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
| |
| put | back to summary |
|---|---|
| public void put(E e) throws InterruptedException Implements java. Inserts the specified element at the tail of this queue, waiting for space to become available if the queue is full.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Reconstitutes this queue from a stream (that is, deserializes it).
| |
| remainingCapacity | back to summary |
|---|---|
| public int remainingCapacity() Implements java. Returns the number of additional elements that this queue can ideally
(in the absence of memory or resource constraints) accept without
blocking. This is always equal to the initial capacity of this queue
less the current Note that you cannot always tell if an attempt to insert
an element will succeed by inspecting | |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides java. Implements java. Removes a single instance of the specified element from this queue,
if it is present. More formally, removes an element Removal of interior elements in circular array based queues is an intrinsically slow and disruptive operation, so should be undertaken only in exceptional circumstances, ideally only when the queue is known not to be accessible by other threads.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> c) Overrides java. Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
| |
| removeAt | back to summary |
|---|---|
| pack-priv void removeAt(final int removeIndex) Deletes item at array index removeIndex. Utility for remove(Object) and iterator.remove. Call only when holding lock. | |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super E> filter) Overrides default java. Doc from java. Removes all of the elements of this collection that satisfy the given predicate (optional operation). Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> c) Overrides java. Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
| |
| setBit | back to summary |
|---|---|
| private static void setBit(long[] bits, int i) | |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Returns the number of elements in this queue.
| |
| spliterator | back to summary |
|---|---|
| public Spliterator Overrides default java. Returns a The returned spliterator is weakly consistent. The Implementation Note The
| |
| take | back to summary |
|---|---|
| public E take() throws InterruptedException Implements java. Doc from java. Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Overrides java. Implements java. Returns an array containing all of the elements in this queue, in proper sequence. The returned array will be "safe" in that no references to it are maintained by this queue. (In other words, this method must allocate a new array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs.
| |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(T[] a) Overrides java. Implements java. Returns an array containing all of the elements in this queue, in proper sequence; the runtime type of the returned array is that of the specified array. If the queue fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this queue. If this queue fits in the specified array with room to spare
(i.e., the array has more elements than this queue), the element in
the array immediately following the end of the queue is set to
Like the Suppose
Note that toArray(new Object[0]) is identical in function to
toArray().
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of this collection. The string
representation consists of a list of the collection's elements in the
order they are returned by its iterator, enclosed in square brackets
( | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Writes the queue to the stream whilst holding the locks to prevent broken invariants.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | cursor
Index to look for new nextItem; NONE at end |
| private static final int | DETACHED
Special value for prevTakeIndex indicating "detached mode" |
| private E | lastItem
Last element returned; null if none or not detached. |
| private int | lastRet
Index of lastItem, NONE if none, REMOVED if removed elsewhere |
| private int | nextIndex
Index of nextItem; NONE if none, REMOVED if removed elsewhere |
| private E | nextItem
Element to be returned by next call to next(); null if none |
| private static final int | NONE
Special index value indicating "not available" or "undefined" |
| private int | prevCycles
Previous value of iters.cycles |
| private int | prevTakeIndex
Previous value of takeIndex, or DETACHED when detached |
| private static final int | REMOVED
Special index value indicating "removed elsewhere", that is, removed by some operation other than a call to this.remove(). |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | detach()
Called when itrs should stop tracking this iterator, either because there are no more indices to update (cursor < 0 && nextIndex < 0 && lastRet < 0) or as a special exception, when lastRet >= 0, because hasNext() is about to return false for the first time. |
| private int | |
| public void | forEachRemaining(Consumer<? super E> action)
Overrides default java. Performs the given action for each remaining element until all elements have been processed or the action throws an exception. |
| public boolean | hasNext()
Implements java. For performance reasons, we would like not to acquire a lock in hasNext in the common case. |
| private int | |
| private void | incorporateDequeues()
Adjusts indices to incorporate all dequeues since the last operation on this iterator. |
| private boolean | invalidated(int index, int prevTakeIndex, long dequeues, int length)
Returns true if index is invalidated by the given number of dequeues, starting from prevTakeIndex. |
| pack-priv boolean | |
| public E | |
| private void | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| pack-priv boolean | Returns: true if this iterator should be unlinked from itrsCalled whenever an interior remove (not at takeIndex) occurred. |
| pack-priv void | shutdown()
Called to notify the iterator that the queue is empty, or that it has fallen hopelessly behind, so that it should abandon any further iteration, except possibly to return one more element from next(), as promised by returning true from hasNext(). |
| pack-priv boolean | Returns: true if this iterator should be unlinked from itrsCalled whenever takeIndex wraps around to zero. |
| cursor | back to summary |
|---|---|
| private int cursor Index to look for new nextItem; NONE at end | |
| DETACHED | back to summary |
|---|---|
| private static final int DETACHED Special value for prevTakeIndex indicating "detached mode" | |
| lastItem | back to summary |
|---|---|
| private E lastItem Last element returned; null if none or not detached. | |
| lastRet | back to summary |
|---|---|
| private int lastRet Index of lastItem, NONE if none, REMOVED if removed elsewhere | |
| nextIndex | back to summary |
|---|---|
| private int nextIndex Index of nextItem; NONE if none, REMOVED if removed elsewhere | |
| nextItem | back to summary |
|---|---|
| private E nextItem Element to be returned by next call to next(); null if none | |
| NONE | back to summary |
|---|---|
| private static final int NONE Special index value indicating "not available" or "undefined" | |
| prevCycles | back to summary |
|---|---|
| private int prevCycles Previous value of iters.cycles | |
| prevTakeIndex | back to summary |
|---|---|
| private int prevTakeIndex Previous value of takeIndex, or DETACHED when detached | |
| REMOVED | back to summary |
|---|---|
| private static final int REMOVED Special index value indicating "removed elsewhere", that is, removed by some operation other than a call to this.remove(). | |
| Itr | back to summary |
|---|---|
| pack-priv Itr() | |
| detach | back to summary |
|---|---|
| private void detach() Called when itrs should stop tracking this iterator, either because there are no more indices to update (cursor < 0 && nextIndex < 0 && lastRet < 0) or as a special exception, when lastRet >= 0, because hasNext() is about to return false for the first time. Call only from iterating thread. | |
| distance | back to summary |
|---|---|
| private int distance(int index, int prevTakeIndex, int length) | |
| forEachRemaining | back to summary |
|---|---|
| public void forEachRemaining(Consumer<? super E> action) Overrides default java. Doc from java. Performs the given action for each remaining element until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.
The behavior of an iterator is unspecified if the action modifies the
collection in any way (even by calling the Subsequent behavior of an iterator is unspecified if the action throws an exception. | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. For performance reasons, we would like not to acquire a lock in hasNext in the common case. To allow for this, we only access fields (i.e. nextItem) that are not modified by update operations triggered by queue modifications. | |
| incCursor | back to summary |
|---|---|
| private int incCursor(int index) | |
| incorporateDequeues | back to summary |
|---|---|
| private void incorporateDequeues() Adjusts indices to incorporate all dequeues since the last operation on this iterator. Call only from iterating thread. | |
| invalidated | back to summary |
|---|---|
| private boolean invalidated(int index, int prevTakeIndex, long dequeues, int length) Returns true if index is invalidated by the given number of dequeues, starting from prevTakeIndex. | |
| isDetached | back to summary |
|---|---|
| pack-priv boolean isDetached() | |
| next | back to summary |
|---|---|
| public E next() Implements java. Doc from java. Returns the next element in the iteration. | |
| noNext | back to summary |
|---|---|
| private void noNext() | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |
| removedAt | back to summary |
|---|---|
| pack-priv boolean removedAt(int removedIndex) Called whenever an interior remove (not at takeIndex) occurred.
| |
| shutdown | back to summary |
|---|---|
| pack-priv void shutdown() Called to notify the iterator that the queue is empty, or that it has fallen hopelessly behind, so that it should abandon any further iteration, except possibly to return one more element from next(), as promised by returning true from hasNext(). | |
| takeIndexWrapped | back to summary |
|---|---|
| pack-priv boolean takeIndexWrapped() Called whenever takeIndex wraps around to zero.
| |
| Modifier and Type | Class and Description |
|---|---|
| private class | ArrayBlockingQueue.
Node in a linked list of weak iterator references. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | cycles
Incremented whenever takeIndex wraps around to 0 |
| private ArrayBlockingQueue | head
Linked list of weak iterator references |
| private static final int | |
| private static final int | |
| private ArrayBlockingQueue | sweeper
Used to expunge stale iterators |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | doSomeSweeping(boolean
whether to start in try-harder mode, because
there is known to be at least one iterator to collect tryHarder)Sweeps itrs, looking for and expunging stale iterators. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void |
| cycles | back to summary |
|---|---|
| pack-priv int cycles Incremented whenever takeIndex wraps around to 0 | |
| head | back to summary |
|---|---|
| private ArrayBlockingQueue<E>. Linked list of weak iterator references | |
| LONG_SWEEP_PROBES | back to summary |
|---|---|
| private static final int LONG_SWEEP_PROBES | |
| SHORT_SWEEP_PROBES | back to summary |
|---|---|
| private static final int SHORT_SWEEP_PROBES | |
| sweeper | back to summary |
|---|---|
| private ArrayBlockingQueue<E>. Used to expunge stale iterators | |
| Itrs | back to summary |
|---|---|
| pack-priv Itrs(ArrayBlockingQueue<E>. | |
| doSomeSweeping | back to summary |
|---|---|
| pack-priv void doSomeSweeping(boolean tryHarder) Sweeps itrs, looking for and expunging stale iterators. If at least one was found, tries harder to find more. Called only from iterating thread.
| |
| elementDequeued | back to summary |
|---|---|
| pack-priv void elementDequeued() Called whenever an element has been dequeued (at takeIndex). | |
| queueIsEmpty | back to summary |
|---|---|
| pack-priv void queueIsEmpty() Called whenever the queue becomes empty. Notifies all active iterators that the queue is empty, clears all weak refs, and unlinks the itrs datastructure. | |
| register | back to summary |
|---|---|
| pack-priv void register(ArrayBlockingQueue<E>. Adds a new iterator to the linked list of tracked iterators. | |
| removedAt | back to summary |
|---|---|
| pack-priv void removedAt(int removedIndex) Called whenever an interior remove (not at takeIndex) occurred. Notifies all iterators, and expunges any that are now stale. | |
| takeIndexWrapped | back to summary |
|---|---|
| pack-priv void takeIndexWrapped() Called whenever takeIndex wraps around to 0. Notifies all iterators, and expunges any that are now stale. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ArrayBlockingQueue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| next | back to summary |
|---|---|
| pack-priv ArrayBlockingQueue<E>. Hides java. | |
| Node | back to summary |
|---|---|
| pack-priv Node(ArrayBlockingQueue<E>. | |