DATATYPE - the data type which can be returnedELEMENTTYPE - the datatype of the underlying listspublic abstract class AbstractMultiListDataSource<DATATYPE,ELEMENTTYPE> extends AbstractDataSource<DATATYPE>
DataSource backed by multiple lists of data.| Modifier and Type | Field and Description |
|---|---|
protected List<? extends List<ELEMENTTYPE>> |
data |
| Constructor and Description |
|---|
AbstractMultiListDataSource(List<? extends List<ELEMENTTYPE>> data)
Construct with the given lists of data
|
AbstractMultiListDataSource(List<ELEMENTTYPE>... data)
Construct with the given lists of data
|
AbstractMultiListDataSource(Map<?,? extends List<ELEMENTTYPE>> data)
Construct with the given map of data.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract DATATYPE |
convert(ELEMENTTYPE ele)
Convert an item's type
|
DATATYPE[] |
createTemporaryArray(int size)
Create a temporary array suitable for use with the
DataSource.getRandomRows(Object[]) and DataSource.getData(int, int, Object[])
methods. |
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 |
size() |
getRandomRows, iteratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnumDimensionsforEach, spliteratorprotected List<? extends List<ELEMENTTYPE>> data
public AbstractMultiListDataSource(List<? extends List<ELEMENTTYPE>> data)
data - the data@SafeVarargs public AbstractMultiListDataSource(List<ELEMENTTYPE>... data)
data - the datapublic AbstractMultiListDataSource(Map<?,? extends List<ELEMENTTYPE>> data)
data - the datapublic void getData(int startRow, int stopRow, DATATYPE[] data)
DataSourceDataSource.size().
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)
DataSourcerow - the row numberprotected abstract DATATYPE convert(ELEMENTTYPE ele)
ele - the input itempublic int size()
public DATATYPE[] createTemporaryArray(int size)
DataSourceDataSource.getRandomRows(Object[]) and DataSource.getData(int, int, Object[])
methods.size - the size of the array