public class DataDataset extends Object implements IDataset
InMemoryDatasetFilter
.
Constructor and Description |
---|
DataDataset(Variant.ScopedClosureVariant dataClosure,
Variant.ScopedClosureVariant dataCountClosure)
Creates the dataset.
|
Modifier and Type | Method and Description |
---|---|
Type |
getItemType()
Returns the type of data returned by the load functions.
|
boolean |
isFilterSupported(Filter filter)
True if given filter criterion is supported.
|
boolean |
isSortSupported(ISort criterion)
True if given sort criterion is supported.
|
List<Object> |
load(int startIndex,
int count)
Load batch of items, mostly records or simple types.
|
void |
setFilter(Set<Filter> filters)
Sets the new filtering criteria.
|
void |
setSort(SortSpec sort)
Sets the new sorting criteria.
|
int |
size()
Gets number of items available through this query.
|
public DataDataset(Variant.ScopedClosureVariant dataClosure, Variant.ScopedClosureVariant dataCountClosure)
dataClosure
- the data providing closure, must have two parameters: start and count. Not null, must be present.dataCountClosure
- a parameterless closure which provides data count. Not null, must be present.public int size()
IDataset
public List<Object> load(int startIndex, int count)
IDataset
IDataset.setSort(SortSpec)
and/or IDataset.setFilter(java.util.Set)
respectively.load
in interface IDataset
startIndex
- Starting index of the item list, must be 0 or greater.count
- Count of the items to be retrieved, must be 0 or greater.RecordHolder
s. Should never fail with out of bounds exception
- if the startIndex or count is out of bounds, the item is simply not returned. The list may or may not be mutable.public void setSort(SortSpec sort)
IDataset
ISort
and
must ignore sort criteria classes of unknown/unsupported types. Next call to IDataset.load(int, int)
must return sorted filtered data.public void setFilter(Set<Filter> filters)
IDataset
ISort
and
must ignore filter criteria classes of unknown/unsupported types. Next call to IDataset.load(int, int)
must return properly filtered data.public boolean isSortSupported(ISort criterion)
IDataset
isSortSupported
in interface IDataset
criterion
- the criterion, not null.public boolean isFilterSupported(Filter filter)
IDataset
isFilterSupported
in interface IDataset
filter
- the filter, not null.public Type getItemType()
IDataset
getItemType
in interface IDataset
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.