Package org.h2.command.query
Class SelectGroups.Grouped
- java.lang.Object
-
- org.h2.command.query.SelectGroups
-
- org.h2.command.query.SelectGroups.Grouped
-
- Enclosing class:
- SelectGroups
private static final class SelectGroups.Grouped extends SelectGroups
-
-
Field Summary
Fields Modifier and Type Field Description private ValueRow
currentGroupsKey
Key into groupByData that produces currentGroupByExprData.private java.util.Iterator<java.util.Map.Entry<ValueRow,java.lang.Object[]>>
cursor
Cursor fornext()
method.private java.util.TreeMap<ValueRow,java.lang.Object[]>
groupByData
Map of group-by key to group-by expression data e.g.private int[]
groupIndex
-
Fields inherited from class org.h2.command.query.SelectGroups
currentGroupByExprData, currentGroupRowId, expressions, session
-
-
Constructor Summary
Constructors Constructor Description Grouped(SessionLocal session, java.util.ArrayList<Expression> expressions, int[] groupIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
done()
Invoked after all source rows are evaluated.ValueRow
next()
Returns the key of the next group.void
nextSource()
Invoked for each source row to evaluate group key and setup all necessary data for aggregates.void
remove()
Removes the data for the current key.void
reset()
Resets this group data for reuse.void
resetLazy()
Resets this group data for reuse in lazy mode.(package private) void
updateCurrentGroupExprData()
Update group-by data specified by implementation.-
Methods inherited from class org.h2.command.query.SelectGroups
createRow, getCurrentGroupExprData, getCurrentGroupRowId, getInstance, getWindowExprData, isCurrentGroup, nextLazyGroup, nextLazyRow, setCurrentGroupExprData, setWindowExprData
-
-
-
-
Field Detail
-
groupIndex
private final int[] groupIndex
-
groupByData
private java.util.TreeMap<ValueRow,java.lang.Object[]> groupByData
Map of group-by key to group-by expression data e.g. AggregateData
-
currentGroupsKey
private ValueRow currentGroupsKey
Key into groupByData that produces currentGroupByExprData. Not used in lazy mode.
-
-
Constructor Detail
-
Grouped
Grouped(SessionLocal session, java.util.ArrayList<Expression> expressions, int[] groupIndex)
-
-
Method Detail
-
reset
public void reset()
Description copied from class:SelectGroups
Resets this group data for reuse.- Overrides:
reset
in classSelectGroups
-
nextSource
public void nextSource()
Description copied from class:SelectGroups
Invoked for each source row to evaluate group key and setup all necessary data for aggregates.- Specified by:
nextSource
in classSelectGroups
-
updateCurrentGroupExprData
void updateCurrentGroupExprData()
Description copied from class:SelectGroups
Update group-by data specified by implementation.- Specified by:
updateCurrentGroupExprData
in classSelectGroups
-
done
public void done()
Description copied from class:SelectGroups
Invoked after all source rows are evaluated.- Overrides:
done
in classSelectGroups
-
next
public ValueRow next()
Description copied from class:SelectGroups
Returns the key of the next group.- Specified by:
next
in classSelectGroups
- Returns:
- the key of the next group, or null
-
remove
public void remove()
Description copied from class:SelectGroups
Removes the data for the current key.- Overrides:
remove
in classSelectGroups
- See Also:
SelectGroups.next()
-
resetLazy
public void resetLazy()
Description copied from class:SelectGroups
Resets this group data for reuse in lazy mode.- Overrides:
resetLazy
in classSelectGroups
-
-