public class ProcessingQueue<T>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ProcessingQueue.Handler<T> |
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.ReentrantLock |
consumer_lock |
protected int |
count |
protected ProcessingQueue.Handler<T> |
handler |
protected java.util.concurrent.locks.ReentrantLock |
producer_lock |
protected java.util.Queue<T> |
queue |
Constructor and Description |
---|
ProcessingQueue() |
Modifier and Type | Method and Description |
---|---|
void |
add(T element) |
java.util.Queue<T> |
getQueue() |
protected void |
process() |
boolean |
retainAll(java.util.Collection<T> elements) |
ProcessingQueue<T> |
setHandler(ProcessingQueue.Handler<T> handler) |
int |
size() |
java.lang.String |
toString() |
protected final java.util.Queue<T> queue
protected final java.util.concurrent.locks.ReentrantLock producer_lock
protected final java.util.concurrent.locks.ReentrantLock consumer_lock
protected int count
protected ProcessingQueue.Handler<T> handler
public java.util.Queue<T> getQueue()
public int size()
public ProcessingQueue<T> setHandler(ProcessingQueue.Handler<T> handler)
public void add(T element)
public boolean retainAll(java.util.Collection<T> elements)
public java.lang.String toString()
toString
in class java.lang.Object
protected void process()
Copyright © 1998-2020 Red Hat. All Rights Reserved.