public class BaseDoubleDataSource extends Object implements DoubleDataSource
Modifier and Type | Field and Description |
---|---|
protected long |
dataLength |
protected DoubleDataSource |
inputSource |
NOT_SPECIFIED
Constructor and Description |
---|
BaseDoubleDataSource() |
BaseDoubleDataSource(DoubleDataSource inputSource) |
Modifier and Type | Method and Description |
---|---|
int |
available()
The number of doubles that can currently be read from this double data source without blocking.
|
double[] |
getAllData()
Get all the data that can be read from this data source, in a single double array.
|
int |
getData(double[] target)
Try to get as many double data from this DoubleDataSource as target can hold.
|
int |
getData(double[] target,
int targetPos,
int length)
Try to get length doubles from this DoubleDataSource, and copy them into target, starting from targetPos.
|
double[] |
getData(int amount)
Request to get the specified amount of data in a new double array.
|
long |
getDataLength()
Get the total length of the data in this data source, if available.
|
boolean |
hasMoreData()
Whether or not any more data can be read from this data source.
|
protected DoubleDataSource inputSource
protected long dataLength
public BaseDoubleDataSource()
public BaseDoubleDataSource(DoubleDataSource inputSource)
public double[] getData(int amount)
getData
in interface DoubleDataSource
amount
- the number of doubles requestedpublic int getData(double[] target)
getData
in interface DoubleDataSource
target
- the double array in which to write the datapublic int getData(double[] target, int targetPos, int length)
getData
in interface DoubleDataSource
target
- the double array to write intotargetPos
- position in target where to start writinglength
- the amount of data requestedIllegalArgumentException
- if there is not enough space in target after targetPos to hold length values.public boolean hasMoreData()
hasMoreData
in interface DoubleDataSource
public int available()
available
in interface DoubleDataSource
public double[] getAllData()
getAllData
in interface DoubleDataSource
OutOfMemoryError
- if a sufficiently large double array cannot be created.public long getDataLength()
getDataLength
in interface DoubleDataSource
Copyright © 2000–2016 DFKI GmbH. All rights reserved.