Modifier and Type | Class and Description |
---|---|
static class |
GroupingDataset.ClosureGroup |
static class |
GroupingDataset.Group |
class |
GroupingDataset.GroupNode |
static class |
GroupingDataset.LineResolvingGroup |
static class |
GroupingDataset.OptClosureGroup |
static class |
GroupingDataset.PropertyGroup |
static interface |
GroupingDataset.Reduction
Reduction function to be performed over grouped items.
|
Constructor and Description |
---|
GroupingDataset(IDataset delegate,
GroupingDataset.Reduction reduction,
boolean showWarnings)
Creates the grouping 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.
|
GroupingDataset.GroupNode |
load()
Loads all data from the underlying dataset, groups it and returns it.
|
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 |
setGroupList(List<GroupingDataset.Group> groupList)
Sets the new grouping criteria.
|
void |
setSort(SortSpec sort)
Sets the new sorting criteria.
|
int |
size()
Gets number of items available through this query.
|
public GroupingDataset(IDataset delegate, GroupingDataset.Reduction reduction, boolean showWarnings)
delegate
- provides data for this dataset. Must not be an instance of GroupingDataset. Not null.reduction
- the reduction function which computes data for aggregate rows, not null.showWarnings
- if true, a warning is logged to stdout when in-memory sorting/filtering of 500 or more items is performed.public void setGroupList(List<GroupingDataset.Group> groupList)
load()
must return properly grouped, sorted and filtered data.groupList
- the group list, not null, may be empty. First, the result list is grouped by the first group, then the
sublists are grouped by the second group, etc.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
public GroupingDataset.GroupNode load()
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.