public class ConcurrentLinkedBlockingQueue2<T>
extends java.util.concurrent.ConcurrentLinkedQueue<T>
implements java.util.concurrent.BlockingQueue<T>
限定符和类型 | 字段和说明 |
---|---|
protected int |
capacity |
protected java.util.concurrent.atomic.AtomicInteger |
count |
protected java.util.concurrent.locks.Condition |
not_empty |
protected java.util.concurrent.locks.Lock |
not_empty_lock |
构造器和说明 |
---|
ConcurrentLinkedBlockingQueue2(int capacity) |
限定符和类型 | 方法和说明 |
---|---|
protected void |
decrCount() |
int |
drainTo(java.util.Collection<? super T> c) |
int |
drainTo(java.util.Collection<? super T> c,
int maxElements) |
protected void |
incrCount() |
boolean |
offer(T t)
Drops elements if capacity has been reached.
|
boolean |
offer(T t,
long timeout,
java.util.concurrent.TimeUnit unit) |
T |
poll() |
T |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
put(T t) |
int |
remainingCapacity() |
boolean |
remove(java.lang.Object o) |
int |
size() |
T |
take() |
protected void |
waitForNotEmpty() |
add, addAll, contains, isEmpty, iterator, peek, toArray, toArray
protected final int capacity
protected final java.util.concurrent.atomic.AtomicInteger count
protected final java.util.concurrent.locks.Lock not_empty_lock
protected final java.util.concurrent.locks.Condition not_empty
public boolean offer(T t)
public T take() throws java.lang.InterruptedException
take
在接口中 java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public T poll()
public T poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll
在接口中 java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public boolean remove(java.lang.Object o)
public int remainingCapacity()
remainingCapacity
在接口中 java.util.concurrent.BlockingQueue<T>
public int drainTo(java.util.Collection<? super T> c)
drainTo
在接口中 java.util.concurrent.BlockingQueue<T>
public void put(T t) throws java.lang.InterruptedException
put
在接口中 java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public boolean offer(T t, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
offer
在接口中 java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public int size()
public int drainTo(java.util.Collection<? super T> c, int maxElements)
drainTo
在接口中 java.util.concurrent.BlockingQueue<T>
protected void waitForNotEmpty() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void decrCount()
protected void incrCount()