DataType
- type of data to be handledpublic class QueueAdapter<DataType> extends AbstractDataHandler<DataType>
Constructor and Description |
---|
QueueAdapter()
Creates an adapter with a preset unlimited queue inside.
|
QueueAdapter(BlockingQueue<DataType> queue)
Creates an adapter that uses the specified queue as target for new data.
|
QueueAdapter(int capacity,
boolean discardOldest)
Creates an adapter with a preset queue inside that is limited to
capacity elements. |
Modifier and Type | Method and Description |
---|---|
BlockingQueue<DataType> |
getQueue()
Returns the queue instance used for new data.
|
void |
handleEvent(DataType data)
Called with the extracted data.
|
internalNotify
public QueueAdapter()
public QueueAdapter(int capacity, boolean discardOldest)
capacity
elements.capacity
- capacity of the internal queuediscardOldest
- if true
, remove older events if the queue is
full, otherwise block until space is available on insertspublic QueueAdapter(BlockingQueue<DataType> queue)
queue
- queue for new datapublic void handleEvent(DataType data)
AbstractDataHandler
handleEvent
in class AbstractDataHandler<DataType>
data
- data contained in the event to handlepublic BlockingQueue<DataType> getQueue()
Copyright © 2018 CoR-Lab. All rights reserved.