Class SizeBlockingQueue<E>
<E>
<E>
org.elasticsearch.common.util.concurrent.SizeBlockingQueue<E>
- All Implemented Interfaces:
<E>
,<E>
,<E>
,<E>
public class SizeBlockingQueue<E>
extends <E>
implements <E>
A size based queue wrapping another blocking queue to provide (somewhat relaxed) capacity checks.
Mainly makes sense to use with blocking queues that are unbounded to provide the ability to do
capacity verification.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
boolean
o)
boolean
<?> c)
int
<? super E> c)
int
<? super E> c, int maxElements)
void
Forces adding an element to the queue, without doing size checks.<E>
iterator()
boolean
boolean
peek()
poll()
poll(long timeout, unit)
void
int
boolean
o)
int
size()
take()
[]
toArray()
<T> T[]
toArray(T[] a)
Methods inherited from class java.util.
, , , ,
Methods inherited from class java.util.
, , ,
Methods inherited from class java.lang.
, , , , , , , , ,
Methods inherited from interface java.util.concurrent.
Methods inherited from interface java.util.
, , , , , , , , , , ,
Methods inherited from interface java.lang.
Methods inherited from interface java.util.
,
-
Constructor Details
-
SizeBlockingQueue
-
-
Method Details
-
size
public int size() -
capacity
public int capacity() -
iterator
-
peek
- Specified by:
in interface
<E>
-
poll
- Specified by:
in interface
<E>
-
poll
- Specified by:
in interface
<E>
- Throws:
-
remove
public boolean remove( o) -
forcePut
Forces adding an element to the queue, without doing size checks.- Throws:
-
offer
-
offer
- Specified by:
in interface
<E>
- Throws:
-
put
- Specified by:
in interface
<E>
- Throws:
-
take
- Specified by:
in interface
<E>
- Throws:
-
remainingCapacity
public int remainingCapacity()- Specified by:
in interface
<E>
-
drainTo
- Specified by:
in interface
<E>
-
drainTo
- Specified by:
in interface
<E>
-
toArray
public [] toArray() -
toArray
public <T> T[] toArray(T[] a) -
contains
public boolean contains( o) -
containsAll
public boolean containsAll(<?> c)
-