# Grouping and Windowing

Site [llms.txt](/gatherers4j/llms.txt)

---

Functions that collect elements into groups or windows


### Gatherers

| Function | Description |
|---|---|
| [group()](https://tginsberg.github.io/gatherers4j/gatherers/grouping-and-windowing/group/index.md) | Turn a `Stream<INPUT>` into a `Stream<List<INPUT>>` where adjacent equal elements are in the same `List` and equality is measured by `Object::equals()`. |
| [groupBy()](https://tginsberg.github.io/gatherers4j/gatherers/grouping-and-windowing/groupby/index.md) | Turn a `Stream<INPUT>` into a `Stream<List<INPUT>>` where adjacent equal elements are in the same `List` and equality is measured by the given `mappingFunction`. |
| [groupOrdered()](https://tginsberg.github.io/gatherers4j/gatherers/grouping-and-windowing/groupordered/index.md) | Convert the input stream of `Comparable` objects into lists of ordered objects. |
| [groupOrderedBy()](https://tginsberg.github.io/gatherers4j/gatherers/grouping-and-windowing/grouporderedby/index.md) | Convert the input stream of objects into lists of ordered objects, as measured by the given `Comparator`. |
| [window()](https://tginsberg.github.io/gatherers4j/gatherers/grouping-and-windowing/window/index.md) | Create windows over the elements of the input stream that are `windowSize` in length, sliding over `stepping` elements and optionally including partial windows at the end of the stream. |

---

Section pages:

- [group()](/gatherers4j/gatherers/grouping-and-windowing/group/): Turn a `Stream<INPUT>` into a `Stream<List<INPUT>>` where adjacent equal elements are in the same `List` and equality is measured by `Object::equals()`.
- [groupBy()](/gatherers4j/gatherers/grouping-and-windowing/groupby/): Turn a `Stream<INPUT>` into a `Stream<List<INPUT>>` where adjacent equal elements are in the same `List` and equality is measured by the given `mappingFunction`.
- [groupOrdered()](/gatherers4j/gatherers/grouping-and-windowing/groupordered/): Convert the input stream of `Comparable` objects into lists of ordered objects.
- [groupOrderedBy()](/gatherers4j/gatherers/grouping-and-windowing/grouporderedby/): Convert the input stream of objects into lists of ordered objects, as measured by the given `Comparator`.
- [window()](/gatherers4j/gatherers/grouping-and-windowing/window/): Create windows over the elements of the input stream that are `windowSize` in length, sliding over `stepping` elements and optionally including partial windows at the end of the stream.
