Package org.eclipse.jetty.util
Class BlockingArrayQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.eclipse.jetty.util.BlockingArrayQueue<E>
- Type Parameters:
E- The element type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,BlockingQueue<E>,List<E>,Queue<E>,SequencedCollection<E>
@Deprecated(since="2021-05-27")
public class BlockingArrayQueue<E>
extends AbstractList<E>
implements BlockingQueue<E>
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
A BlockingQueue backed by a circular array capable or growing.
This queue is uses a variant of the two lock queue algorithm to provide an efficient queue or list backed by a growable circular array.
Unlike ArrayBlockingQueue, this class is able to grow and provides a blocking put call.
The queue has both a capacity (the size of the array currently allocated) and a max capacity (the maximum size that may be allocated), which defaults to
Integer.MAX_VALUE.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.Default initial capacity, 128.static final intDeprecated.Default growth factor, 64. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates an unboundedBlockingArrayQueuewith default initial capacity and grow factor.BlockingArrayQueue(int maxCapacity) Deprecated.Creates a boundedBlockingArrayQueuethat does not grow.BlockingArrayQueue(int capacity, int growBy) Deprecated.Creates an unboundedBlockingArrayQueuethat grows by the given parameter.BlockingArrayQueue(int capacity, int growBy, int maxCapacity) Deprecated.Create a boundedBlockingArrayQueuethat grows by the given parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.booleanDeprecated.voidclear()Deprecated.intdrainTo(Collection<? super E> c) Deprecated.intdrainTo(Collection<? super E> c, int maxElements) Deprecated.element()Deprecated.get(int index) Deprecated.intDeprecated.intDeprecated.iterator()Deprecated.listIterator(int index) Deprecated.booleanDeprecated.booleanDeprecated.peek()Deprecated.poll()Deprecated.Deprecated.voidDeprecated.intDeprecated.remove()Deprecated.remove(int index) Deprecated.booleanDeprecated.Deprecated.intsize()Deprecated.take()Deprecated.Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringMethods inherited from interface java.util.concurrent.BlockingQueue
containsMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Field Details
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITYDeprecated.Default initial capacity, 128.- See Also:
-
DEFAULT_GROWTH
public static final int DEFAULT_GROWTHDeprecated.Default growth factor, 64.- See Also:
-
-
Constructor Details
-
BlockingArrayQueue
public BlockingArrayQueue()Deprecated.Creates an unboundedBlockingArrayQueuewith default initial capacity and grow factor.- See Also:
-
BlockingArrayQueue
public BlockingArrayQueue(int maxCapacity) Deprecated.Creates a boundedBlockingArrayQueuethat does not grow. The capacity of the queue is fixed and equal to the given parameter.- Parameters:
maxCapacity- the maximum capacity
-
BlockingArrayQueue
public BlockingArrayQueue(int capacity, int growBy) Deprecated.Creates an unboundedBlockingArrayQueuethat grows by the given parameter.- Parameters:
capacity- the initial capacitygrowBy- the growth factor
-
BlockingArrayQueue
public BlockingArrayQueue(int capacity, int growBy, int maxCapacity) Deprecated.Create a boundedBlockingArrayQueuethat grows by the given parameter.- Parameters:
capacity- the initial capacitygrowBy- the growth factormaxCapacity- the maximum capacity
-
-
Method Details
-
clear
public void clear()Deprecated.- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-
size
public int size()Deprecated.- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
iterator
Deprecated. -
poll
Deprecated. -
peek
Deprecated. -
remove
Deprecated. -
element
Deprecated. -
offer
Deprecated. -
add
Deprecated.- Specified by:
addin interfaceBlockingQueue<E>- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>- Specified by:
addin interfaceQueue<E>- Overrides:
addin classAbstractList<E>
-
put
Deprecated.- Specified by:
putin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
offer
Deprecated.- Specified by:
offerin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
take
Deprecated.- Specified by:
takein interfaceBlockingQueue<E>- Throws:
InterruptedException
-
poll
Deprecated.- Specified by:
pollin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
remove
Deprecated.- Specified by:
removein interfaceBlockingQueue<E>- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classAbstractCollection<E>
-
remainingCapacity
public int remainingCapacity()Deprecated.- Specified by:
remainingCapacityin interfaceBlockingQueue<E>
-
drainTo
Deprecated.- Specified by:
drainToin interfaceBlockingQueue<E>
-
drainTo
Deprecated.- Specified by:
drainToin interfaceBlockingQueue<E>
-
get
Deprecated. -
add
Deprecated. -
set
Deprecated. -
remove
Deprecated. -
listIterator
Deprecated.- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classAbstractList<E>
-
getCapacity
public int getCapacity()Deprecated.- Returns:
- the current capacity of this queue
-
getMaxCapacity
public int getMaxCapacity()Deprecated.- Returns:
- the max capacity of this queue, or -1 if this queue is unbounded
-