DATATYPE
- the data type which can be returnedpublic class IndexedViewDataSource<DATATYPE> extends AbstractDataSource<DATATYPE>
DataSource
provides an indexed view of a subset of another
DataSource
.Constructor and Description |
---|
IndexedViewDataSource(DataSource<DATATYPE> dataSource,
int[] indexes)
Construct a new
IndexedViewDataSource with the given inner data
and indexes into the inner data. |
Modifier and Type | Method and Description |
---|---|
DATATYPE |
getData(int row)
Get the data for a given row
|
void |
getData(int startRow,
int stopRow,
DATATYPE[] data)
Get data between given rows.
|
int |
numDimensions() |
int |
numRows() |
getRandomRows, iterator
public IndexedViewDataSource(DataSource<DATATYPE> dataSource, int[] indexes)
IndexedViewDataSource
with the given inner data
and indexes into the inner data.dataSource
- the inner DataSource
.indexes
- the indexed into the inner datasource.public void getData(int startRow, int stopRow, DATATYPE[] data)
DataSource
DataSource.numRows()
.
data is guaranteed to have (stopRow - startRow) valid entriesstartRow
- where to start (inclusive)stopRow
- where to stop (exclusive)data
- the array to fillpublic DATATYPE getData(int row)
DataSource
row
- the row numberpublic int numDimensions()
public int numRows()