Interface Grouper<R,T>
- All Superinterfaces:
AutoCloseable
,Closeable
Interface which processes groups of rows into other groups of rows.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Is used to generate a newGrouper
instance for every query against the target table. -
Method Summary
Modifier and TypeMethodDescriptionaccumulate
(R source) Is called for each source row in the group, other than the first one, and then thestep
method is called.Is called for the first source row in the group, and then thestep
method is called.default void
close()
Is called when thisGrouper
instance is no longer needed.default void
finished()
Is called after the last source row in the group has been provided, and then thestep
method is called.Is called to produce the next target row.
-
Method Details
-
begin
Is called for the first source row in the group, and then thestep
method is called.- Parameters:
source
- never null- Returns:
- the next source row instance to use, or null if it was kept by the grouper
- Throws:
IOException
-
accumulate
Is called for each source row in the group, other than the first one, and then thestep
method is called.- Parameters:
source
- never null- Returns:
- the next source row instance to use, or null if it was kept by the grouper
- Throws:
IOException
-
finished
Is called after the last source row in the group has been provided, and then thestep
method is called.- Throws:
IOException
-
step
Is called to produce the next target row. Returning null indicates that no target rows remain, and that reading of source group rows can resume.- Parameters:
target
- never null; all columns are initially unset- Returns:
- null if no target rows remain
- Throws:
IOException
-
close
Is called when thisGrouper
instance is no longer needed.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-