| Modifier and Type | Field and Description |
|---|---|
| private final Queue | head
The first elements seen. |
| private final Queue | tail
The elements seen most recently, excluding anything already on |
| Access | Constructor and Description |
|---|---|
| pack-priv | HeadTailAccumulator(int
the maximum number of elements to retain from the start of the stream headCapacity, int the maximum number of elements to retain from the end of the stream. tailCapacity)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | add(final T
the element to add (may be element)null)Adds an element to the accumulator, possibly displacing an older element. |
| pack-priv Stream |
| head | back to summary |
|---|---|
| private final Queue<T> head The first elements seen. | |
| tail | back to summary |
|---|---|
| private final Queue<T> tail The elements seen most recently, excluding anything already on | |
| HeadTailAccumulator | back to summary |
|---|---|
| pack-priv HeadTailAccumulator(int headCapacity, int tailCapacity) Creates a new
| |
| add | back to summary |
|---|---|
| pack-priv void add(final T element) Adds an element to the accumulator, possibly displacing an older element.
| |
| stream | back to summary |
|---|---|
| pack-priv Stream Converts the accumulated elements into a stream.
| |