Gatherers

The gatherers in this library are categorized into five groups to make things easier to find and understand.

Sequence Operations which reorder, combine, or manipulate the sequence of elements.

Filtering and Selection which select or remove elements based on some criteria.

Grouping and Windowing which collect elements into groups or windows.

Mathematical Operations which perform calculations over the stream.

Validation and Constraints which enforce conditions on the stream.

Full List of Gatherers

TitleDescription
crossWith()Cross every element of the input stream with every element of the given source, emitting them to the output stream as a Pair<INPUT, CROSS>.
debounce()Limit the number of elements in the stream to some number per period, dropping anything over the limit during the period.
dedupeConsecutive()Remove consecutive duplicate elements from a stream where equality is measured by Object::equals()
dedupeConsecutiveBy()Remove consecutive duplicates, where equality is measured by a given function
distinctBy()Filter a stream such that it only contains distinct elements measured by the given mappingFunction.
dropEveryNth()Drop every nth element of the stream.
dropLast()Keep all elements except the last count elements of the stream.
ensureOrdered()Ensure that the Comparable elements in the input stream are in the order specified, and fail exceptionally if they are not.
ensureOrderedBy()Ensure that the elements in the input stream are in the order specified, as measured by the given Comparator, and fail exceptionally if they are not.
ensureSize()Ensure the input stream is the proper length as specified by size
filterIndexed()Filter a stream according to a given predicate, which takes both the item being examined and its index.
filterInstanceOf()Filter the elements in the stream to only include elements of the given types.
filterOrdered()Filter the input stream so that it contains Comparable<INPUT> elements in the order provided.
filterOrderedBy()Filter the input stream so that it contains elements the order specified as measured by the given Comparator.
foldIndexed()Perform a fold over every element in the input stream along with its index
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()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()Convert the input stream of Comparable objects into lists of ordered objects.
groupOrderedBy()Convert the input stream of objects into lists of ordered objects, as measured by the given Comparator.
interleaveWith()Creates a stream of alternating objects from the input stream and the argument source
movingProduct()Calculate the moving product of a Stream<BigDecimal> looking back windowSize number of elements.
movingProductBy()Calculate the moving product of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize number of elements.
movingSum()Calculate the moving sum of a Stream<BigDecimal> looking back windowSize number of elements.
movingSumBy()Calculate the moving sum of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize number of elements.
orderByFrequency()Emit elements in the input stream ordered by the specified frequency.
repeat()Repeatedly emit the input stream to the output stream a given number of times.
repeatInfinitely()Repeatedly emit the input stream to the output stream, infinitely.
reverse()everse the order of the input stream.
rotate()Consume the entire stream and emit its elements rotated either left or right distance number of spaces
runningPopulationStandardDeviation()Calculate the running population standard deviation of a Stream<BigDecimal>.
runningPopulationStandardDeviationBy()Calculate the running population standard deviation of a BigDecimal objects mapped from a Stream<BigDecimal> via a mappingFunction.
runningProduct()Calculate the running product of a Stream<BigDecimal>.
runningProductBy()Calculate the running product of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
runningSampleStandardDeviation()Calculate the running sample standard deviation of a Stream<BigDecimal>.
runningSampleStandardDeviationBy()Calculate the running sample standard deviation of a BigDecimal objects mapped from a Stream<BigDecimal> via a mappingFunction.
runningSum()Calculate the running sum of a Stream<BigDecimal>.
runningSumBy()Calculate the running sum of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
scanIndexed()Perform a scan over every element in the input stream along with its index
shuffle()Shuffle the input stream into a random order.
simpleMovingAverage()Calculate the simple moving average of BigDecimal values over the previous windowSize number of values.
simpleMovingAverageBy()Calculate the simple moving average of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction and looking back windowSize number of elements.
simpleRunningAverage()Calculate the simple running average of a Stream<BigDecimal>.
simpleRunningAverageBy()Calculate the simple running average of BigDecimal objects mapped from a Stream<INPUT> via a mappingFunction.
takeEveryNth()Take every nth element of the stream.
takeLast()Remove all but the last count elements from the stream
takeUntil()Take elements from the input stream until the predicate is met, including the first element that matches the predicate.
throttle()Limit the number of elements in the stream to some number per period. When the limit is reached consumption is paused until a new period starts and the count resets.
uniquelyOccurring()Emit only those elements that occur in the input stream a single time.
window()Create windows over the elements of the input stream that are windowSize in length, sliding over stepping number of elements and optionally including partial windows at the end of ths stream.
withIndex()Maps all elements of the stream as-is along with their 0-based index.
zipWith()Creates a stream of Pair<FIRST,SECOND> objects whose values come from the input stream and the source of arguments provided
zipWithNext()Creates a stream of List objects which contain each two adjacent elements in the input stream.