T
- Object this queue consumespublic abstract class Queue<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected BlockingQueue<T> |
queue |
protected Setup<T> |
setup |
Constructor and Description |
---|
Queue(BlockingQueue<T> queue)
Constructor, defines queue.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T object)
Add a object to the queue, default implementation.
|
int |
size()
Get how many objects are in the queue.
|
void |
stop()
Stops all activity and clears the queue.
|
List<T> |
stopAndReturnLeftovers()
Used to stop the queue processing and get the unprocessed objects.
|
protected final BlockingQueue<T> queue
public Queue(BlockingQueue<T> queue)
queue
- BlockingQueue to use for this queue.public void add(T object)
object
- Object to add.public List<T> stopAndReturnLeftovers()
public void stop()
public int size()
Copyright © 2017. All rights reserved.