@InterfaceAudience.Private @InterfaceStability.Evolving public class TimeoutBlockingQueue<E> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
TimeoutBlockingQueue.TimeoutRetriever<T> |
Modifier and Type | Field and Description |
---|---|
private int |
head |
private ReentrantLock |
lock |
private E[] |
objects |
private int |
tail |
private TimeoutBlockingQueue.TimeoutRetriever<? super E> |
timeoutRetriever |
private Condition |
waitCond |
Constructor and Description |
---|
TimeoutBlockingQueue(int capacity,
TimeoutBlockingQueue.TimeoutRetriever<? super E> timeoutRetriever) |
TimeoutBlockingQueue(TimeoutBlockingQueue.TimeoutRetriever<? super E> timeoutRetriever) |
Modifier and Type | Method and Description |
---|---|
void |
add(E e) |
private void |
addElement(E elem) |
void |
clear() |
private int |
compareTimeouts(E a,
E b) |
void |
dump() |
private long |
getNanosTimeout(E obj) |
boolean |
isEmpty() |
E |
poll() |
private E |
removeFirst() |
void |
signalAll() |
int |
size() |
private int |
upperBound(int start,
int end,
E key) |
private final ReentrantLock lock
private final Condition waitCond
private final TimeoutBlockingQueue.TimeoutRetriever<? super E> timeoutRetriever
private E[] objects
private int head
private int tail
public TimeoutBlockingQueue(TimeoutBlockingQueue.TimeoutRetriever<? super E> timeoutRetriever)
public TimeoutBlockingQueue(int capacity, TimeoutBlockingQueue.TimeoutRetriever<? super E> timeoutRetriever)
public void dump()
public void clear()
public void add(E e)
public E poll()
public int size()
public boolean isEmpty()
public void signalAll()
private void addElement(E elem)
private E removeFirst()
private int upperBound(int start, int end, E key)
private long getNanosTimeout(E obj)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.