public abstract class ProducingDoubleDataSource extends BufferedDoubleDataSource implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected ArrayBlockingQueue<Double> |
queue |
buf, dataProcessor, DEFAULT_BUFFERSIZE, readPos, writePosdataLength, inputSourceNOT_SPECIFIED| Modifier | Constructor and Description |
|---|---|
protected |
ProducingDoubleDataSource() |
protected |
ProducingDoubleDataSource(InlineDataProcessor dataProcessor) |
protected |
ProducingDoubleDataSource(long numDataThatWillBeProduced) |
protected |
ProducingDoubleDataSource(long numDataThatWillBeProduced,
InlineDataProcessor dataProcessor) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
The number of doubles that can currently be read from this double data source without blocking.
|
boolean |
hasMoreData()
Whether or not any more data can be read from this data source.
|
protected void |
putEndOfStream() |
void |
putOneDataPoint(double value)
The producing thread tries to put ont data item into the queue.
|
protected boolean |
readIntoBuffer(int minLength)
Attempt to get more data from the input source.
|
abstract void |
run()
Subclasses must implement this method such that it produces data and sends it through
putOneDataPoint(double). |
void |
start() |
bufferSpaceLeft, compact, currentlyInBuffer, getData, increaseBufferSizegetAllData, getData, getData, getDataLengthprotected ArrayBlockingQueue<Double> queue
protected ProducingDoubleDataSource()
protected ProducingDoubleDataSource(long numDataThatWillBeProduced)
protected ProducingDoubleDataSource(InlineDataProcessor dataProcessor)
protected ProducingDoubleDataSource(long numDataThatWillBeProduced,
InlineDataProcessor dataProcessor)
public void start()
public abstract void run()
putOneDataPoint(double).
When all data is sent, the subclass must call putEndOfStream() exactly once.public void putOneDataPoint(double value)
value - valueRuntimeException - runtime exceptionprotected void putEndOfStream()
public boolean hasMoreData()
BufferedDoubleDataSourcehasMoreData in interface DoubleDataSourcehasMoreData in class BufferedDoubleDataSourcepublic int available()
BufferedDoubleDataSourceavailable in interface DoubleDataSourceavailable in class BufferedDoubleDataSourceprotected boolean readIntoBuffer(int minLength)
BufferedDoubleDataSourcereadIntoBuffer in class BufferedDoubleDataSourceminLength - the amount of data to get from the input sourceCopyright © 2000–2016 DFKI GmbH. All rights reserved.