Package | Description |
---|---|
com.tangosol.util.stream |
Contains classes to support functional-style operations on remote streams of elements, such as map-reduce transformations on collections.
|
Modifier and Type | Method and Description |
---|---|
static <T,U> RemoteCollector<T,?,Double> |
RemoteCollectors.averagingDouble(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector that produces the arithmetic mean of a double-valued function applied to the input elements. |
static <T,U> RemoteCollector<T,?,Double> |
RemoteCollectors.averagingInt(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector that produces the arithmetic mean of an integer-valued function applied to the input elements. |
static <T,U> RemoteCollector<T,?,Double> |
RemoteCollectors.averagingLong(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector that produces the arithmetic mean of a long-valued function applied to the input elements. |
static <T,A,R,RR> RemoteCollector<T,A,RR> |
RemoteCollectors.collectingAndThen(RemoteCollector<T,A,R> downstream, Remote.Function<R,RR> finisher)
Adapts a
Collector to perform an additional finishing transformation. |
static <T> RemoteCollector<T,?,Long> |
RemoteCollectors.counting()
Returns a
Collector accepting elements of type T that counts the number of input elements. |
static <T,U,K> RemoteCollector<T,?,Map<K,List<T>>> |
RemoteCollectors.groupingBy(ValueExtractor<? super U,? extends K> classifier)
Returns a
Collector implementing a "group by" operation on input elements of type T , grouping elements according to a classification function, and returning the results in a Map . |
static <T,U,K,D,A,M extends Map<K,D>> |
RemoteCollectors.groupingBy(ValueExtractor<? super U,? extends K> extractor, Remote.Supplier<M> mapFactory, RemoteCollector<? super T,A,D> downstream)
Returns a
Collector implementing a cascaded "group by" operation on input elements of type T , grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector . |
static <T,U,K,A,D> |
RemoteCollectors.groupingBy(ValueExtractor<? super U,? extends K> classifier, RemoteCollector<? super T,A,D> downstream)
Returns a
Collector implementing a cascaded "group by" operation on input elements of type T , grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector . |
static <T,U,A,R> RemoteCollector<T,A,R> |
RemoteCollectors.mapping(Remote.Function<? super T,? extends U> mapper, RemoteCollector<? super U,A,R> downstream)
Adapts a
Collector accepting elements of type U to one accepting elements of type T by applying a mapping function to each input element before accumulation. |
static <T> RemoteCollector<T,?,Optional<T>> |
RemoteCollectors.maxBy(Remote.Comparator<? super T> comparator)
Returns a
Collector that produces the maximal element according to a given Comparator , described as an Optional<T> . |
static <T> RemoteCollector<T,?,Optional<T>> |
RemoteCollectors.minBy(Remote.Comparator<? super T> comparator)
Returns a
Collector that produces the minimal element according to a given Comparator , described as an Optional<T> . |
static <T,A,R> RemoteCollector<T,A,R> |
RemoteCollector.of(Remote.Supplier<A> supplier, Remote.BiConsumer<A,T> accumulator, Remote.BinaryOperator<A> combiner, Remote.Function<A,R> finisher, Collector.Characteristics... characteristics)
Returns a new
Collector described by the given supplier , accumulator , combiner , and finisher functions. |
static <T,R> RemoteCollector<T,R,R> |
RemoteCollector.of(Remote.Supplier<R> supplier, Remote.BiConsumer<R,T> accumulator, Remote.BinaryOperator<R> combiner, Collector.Characteristics... characteristics)
Returns a new
Collector described by the given supplier , accumulator , and combiner functions. |
static <T,A,R> RemoteCollector<T,A,R> |
RemoteCollector.of(Supplier<A> supplier, BiConsumer<A,T> accumulator, BinaryOperator<A> combiner, Function<A,R> finisher, Collector.Characteristics... characteristics)
Returns a new
Collector described by the given supplier , accumulator , combiner , and finisher functions. |
static <T,R> RemoteCollector<T,R,R> |
RemoteCollector.of(Supplier<R> supplier, BiConsumer<R,T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics)
Returns a new
Collector described by the given supplier , accumulator , and combiner functions. |
static <T> RemoteCollector<T,?,Optional<T>> |
RemoteCollectors.reducing(Remote.BinaryOperator<T> op)
Returns a
Collector which performs a reduction of its input elements under a specified BinaryOperator . |
static <T> RemoteCollector<T,SimpleHolder<T>,T> |
RemoteCollectors.reducing(T identity, Remote.BinaryOperator<T> op)
Returns a
Collector which performs a reduction of its input elements under a specified BinaryOperator using the provided identity. |
static <T,U> RemoteCollector<T,?,U> |
RemoteCollectors.reducing(U identity, Remote.BiFunction<? super U,? super T,? extends U> mapper, Remote.BinaryOperator<U> op)
Returns a
Collector which performs a reduction of its input elements under a specified mapping function and BinaryOperator . |
static <T,U> RemoteCollector<T,?,U> |
RemoteCollectors.reducing(U identity, Remote.Function<? super T,? extends U> mapper, Remote.BinaryOperator<U> op)
Returns a
Collector which performs a reduction of its input elements under a specified mapping function and BinaryOperator . |
static <T,U> RemoteCollector<T,?,com.tangosol.internal.util.DoubleSummaryStatistics> |
RemoteCollectors.summarizingDouble(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector which applies an double -producing mapping function to each input element, and returns summary statistics for the resulting values. |
static <T,U> RemoteCollector<T,?,com.tangosol.internal.util.IntSummaryStatistics> |
RemoteCollectors.summarizingInt(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector which applies an int -producing mapping function to each input element, and returns summary statistics for the resulting values. |
static <T,U> RemoteCollector<T,?,com.tangosol.internal.util.LongSummaryStatistics> |
RemoteCollectors.summarizingLong(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector which applies an long -producing mapping function to each input element, and returns summary statistics for the resulting values. |
static <T,U> RemoteCollector<T,?,Double> |
RemoteCollectors.summingDouble(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector that produces the sum of a double-valued function applied to the input elements. |
static <T,U> RemoteCollector<T,?,Integer> |
RemoteCollectors.summingInt(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector that produces the sum of a integer-valued function applied to the input elements. |
static <T,U> RemoteCollector<T,?,Long> |
RemoteCollectors.summingLong(ValueExtractor<? super U,? extends Number> extractor)
Returns a
Collector that produces the sum of a long-valued function applied to the input elements. |
static <T,C extends Collection<T>> |
RemoteCollectors.toCollection(Remote.Supplier<C> supplier)
Returns a
Collector that accumulates the input elements into a new Collection , in encounter order. |
static <T> RemoteCollector<T,?,List<T>> |
RemoteCollectors.toList()
Returns a
Collector that accumulates the input elements into a new List . |
static <T,U1,U2,K,V> |
RemoteCollectors.toMap(ValueExtractor<? super U1,? extends K> keyMapper, ValueExtractor<? super U2,? extends V> valueMapper)
Returns a
Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. |
static <T,U1,U2,K,V> |
RemoteCollectors.toMap(ValueExtractor<? super U1,? extends K> keyMapper, ValueExtractor<? super U2,? extends V> valueMapper, Remote.BinaryOperator<V> mergeFunction)
Returns a
Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. |
static <T,U1,U2,K,V,M extends Map<K,V>> |
RemoteCollectors.toMap(ValueExtractor<? super U1,? extends K> keyExtractor, ValueExtractor<? super U2,? extends V> valueExtractor, Remote.BinaryOperator<V> mergeFunction, Remote.Supplier<M> mapSupplier)
Returns a
Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. |
static <T> RemoteCollector<T,?,Set<T>> |
RemoteCollectors.toSet()
Returns a
Collector that accumulates the input elements into a new Set . |
static <T> RemoteCollector<T,?,Collection<T>> |
RemoteCollectors.toSortedBag()
Returns a
Collector that accumulates the input elements into a new SortedBag . |
static <T> RemoteCollector<T,?,Collection<T>> |
RemoteCollectors.toSortedBag(Comparator<? super T> comparator)
Returns a
Collector that accumulates the input elements into a new SortedBag . |
static <T> RemoteCollector<T,?,Collection<T>> |
RemoteCollectors.toSortedBag(Remote.Comparator<? super T> comparator)
Returns a
Collector that accumulates the input elements into a new SortedBag . |
static <T> RemoteCollector<T,?,SortedSet<T>> |
RemoteCollectors.toSortedSet()
Returns a
Collector that accumulates the input elements into a new SortedSet . |
static <T> RemoteCollector<T,?,SortedSet<T>> |
RemoteCollectors.toSortedSet(Comparator<? super T> comparator)
Returns a
Collector that accumulates the input elements into a new SortedSet . |
static <T> RemoteCollector<T,?,SortedSet<T>> |
RemoteCollectors.toSortedSet(Remote.Comparator<? super T> comparator)
Returns a
Collector that accumulates the input elements into a new SortedSet . |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
RemoteStream.collect(RemoteCollector<? super T,A,R> collector)
Performs a mutable reduction operation on the elements of this stream using a
Collector . |
static <T,A,R,RR> RemoteCollector<T,A,RR> |
RemoteCollectors.collectingAndThen(RemoteCollector<T,A,R> downstream, Remote.Function<R,RR> finisher)
Adapts a
Collector to perform an additional finishing transformation. |
static <T,U,K,D,A,M extends Map<K,D>> |
RemoteCollectors.groupingBy(ValueExtractor<? super U,? extends K> extractor, Remote.Supplier<M> mapFactory, RemoteCollector<? super T,A,D> downstream)
Returns a
Collector implementing a cascaded "group by" operation on input elements of type T , grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector . |
static <T,U,K,A,D> |
RemoteCollectors.groupingBy(ValueExtractor<? super U,? extends K> classifier, RemoteCollector<? super T,A,D> downstream)
Returns a
Collector implementing a cascaded "group by" operation on input elements of type T , grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstream Collector . |
static <T,U,A,R> RemoteCollector<T,A,R> |
RemoteCollectors.mapping(Remote.Function<? super T,? extends U> mapper, RemoteCollector<? super U,A,R> downstream)
Adapts a
Collector accepting elements of type U to one accepting elements of type T by applying a mapping function to each input element before accumulation. |