|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<E>
jsr166y.LinkedTransferQueue<E>
com.jolbox.bonecp.BoundedLinkedTransferQueue<E>
E - public class BoundedLinkedTransferQueue<E>
A bounded version of linkedTransferQueue.
| Constructor Summary | |
|---|---|
BoundedLinkedTransferQueue(int maxQueueSize)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
offer(E e)
Inserts the specified element at the tail of this queue. |
E |
poll()
|
E |
poll(long timeout,
TimeUnit unit)
|
void |
put(E e)
Inserts the specified element at the tail of this queue. |
int |
remainingCapacity()
Returns the number of free slots in this queue. |
int |
size()
Returns the number of elements in this queue. |
boolean |
tryTransfer(E e)
Transfers the element to a waiting consumer immediately, if possible. |
| Methods inherited from class jsr166y.LinkedTransferQueue |
|---|
add, drainTo, drainTo, getWaitingConsumerCount, hasWaitingConsumer, isEmpty, iterator, offer, peek, remove, take, transfer, tryTransfer |
| Methods inherited from class java.util.AbstractQueue |
|---|
addAll, clear, element, remove |
| Methods inherited from class java.util.AbstractCollection |
|---|
contains, containsAll, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.BlockingQueue |
|---|
contains |
| Methods inherited from interface java.util.Queue |
|---|
element, remove |
| Methods inherited from interface java.util.Collection |
|---|
addAll, clear, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public BoundedLinkedTransferQueue(int maxQueueSize)
maxQueueSize - | Method Detail |
|---|
public int size()
LinkedTransferQueueInteger.MAX_VALUE elements, returns
Integer.MAX_VALUE.
Beware that, unlike in most collections, this method is NOT a constant-time operation. Because of the asynchronous nature of these queues, determining the current number of elements requires an O(n) traversal.
size in interface Collection<E>size in class LinkedTransferQueue<E>public int remainingCapacity()
remainingCapacity in interface BlockingQueue<E>remainingCapacity in class LinkedTransferQueue<E>public E poll()
poll in interface Queue<E>poll in class LinkedTransferQueue<E>
public E poll(long timeout,
TimeUnit unit)
throws InterruptedException
poll in interface BlockingQueue<E>poll in class LinkedTransferQueue<E>InterruptedExceptionpublic boolean tryTransfer(E e)
LinkedTransferQueueMore precisely, transfers the specified element immediately
if there exists a consumer already waiting to receive it (in
LinkedTransferQueue.take() or timed poll),
otherwise returning false without enqueuing the element.
tryTransfer in interface TransferQueue<E>tryTransfer in class LinkedTransferQueue<E>e - the element to transfer
true if the element was transferred, else
falsepublic boolean offer(E e)
LinkedTransferQueuefalse.
offer in interface BlockingQueue<E>offer in interface Queue<E>offer in class LinkedTransferQueue<E>true (as specified by
BlockingQueue.offer)public void put(E e)
LinkedTransferQueue
put in interface BlockingQueue<E>put in class LinkedTransferQueue<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||