public class BufferedDoubleDataSource extends BaseDoubleDataSource
Modifier and Type | Field and Description |
---|---|
protected double[] |
buf |
protected InlineDataProcessor |
dataProcessor |
static int |
DEFAULT_BUFFERSIZE |
protected int |
readPos |
protected int |
writePos |
dataLength, inputSource
NOT_SPECIFIED
Constructor and Description |
---|
BufferedDoubleDataSource(double[] inputData) |
BufferedDoubleDataSource(double[] inputData,
InlineDataProcessor dataProcessor) |
BufferedDoubleDataSource(DoubleDataSource inputSource) |
BufferedDoubleDataSource(DoubleDataSource inputSource,
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.
|
protected int |
bufferSpaceLeft() |
protected void |
compact()
Compact the buffer, so that the data in the buffer starts at the beginning of the underlying array.
|
int |
currentlyInBuffer()
Amount of data currently in the buffer.
|
int |
getData(double[] target,
int targetPos,
int length)
Try to get length doubles from this DoubleDataSource, and copy them into target, starting from targetPos.
|
boolean |
hasMoreData()
Whether or not any more data can be read from this data source.
|
protected void |
increaseBufferSize(int minSize)
Increase the underlying buffer array in size, so that the new size is at least minSize
|
protected boolean |
readIntoBuffer(int minLength)
Attempt to get more data from the input source.
|
getAllData, getData, getData, getDataLength
public static final int DEFAULT_BUFFERSIZE
protected double[] buf
protected int readPos
protected int writePos
protected InlineDataProcessor dataProcessor
public BufferedDoubleDataSource(double[] inputData)
public BufferedDoubleDataSource(double[] inputData, InlineDataProcessor dataProcessor)
public BufferedDoubleDataSource(DoubleDataSource inputSource)
public BufferedDoubleDataSource(DoubleDataSource inputSource, InlineDataProcessor dataProcessor)
public boolean hasMoreData()
hasMoreData
in interface DoubleDataSource
hasMoreData
in class BaseDoubleDataSource
public int currentlyInBuffer()
public int available()
available
in interface DoubleDataSource
available
in class BaseDoubleDataSource
protected int bufferSpaceLeft()
public int getData(double[] target, int targetPos, int length)
getData
in interface DoubleDataSource
getData
in class BaseDoubleDataSource
target
- the double array to write intotargetPos
- position in target where to start writinglength
- the amount of data requestedprotected boolean readIntoBuffer(int minLength)
minLength
- the amount of data to get from the input sourceprotected void increaseBufferSize(int minSize)
minSize
- the minimum new size of the array.protected void compact()
Copyright © 2000–2016 DFKI GmbH. All rights reserved.