Package | Description |
---|---|
com.annimon.stream | |
com.annimon.stream.function |
Modifier and Type | Method and Description |
---|---|
static <K,V,R> Function<java.util.Map.Entry<K,V>,R> |
Fn.applyByKey(Function<? super K,R> func) |
static <K,V,R> Function<java.util.Map.Entry<K,V>,R> |
Fn.applyByValue(Function<? super V,R> func) |
static <T,U> Function<T,U> |
Fn.cast(java.lang.Class<U> clazz) |
Function<A,R> |
Collector.finisher()
Function produces result by transforming intermediate type.
|
static <T> Function<T,T> |
Fn.identity() |
static <K,V> Function<java.util.Map.Entry<K,V>,K> |
Fn.key() |
static <K,V,KK> Function<java.util.Map.Entry<K,V>,java.util.Map.Entry<KK,V>> |
Fn.mapKey(Function<? super K,KK> func) |
static <K,V,VV> Function<java.util.Map.Entry<K,V>,java.util.Map.Entry<K,VV>> |
Fn.mapValue(Function<? super V,VV> func) |
static Function<java.lang.String,java.lang.String> |
Fn.trim() |
static Function<java.lang.String,java.lang.String> |
Fn.trimToEmpty() |
static Function<java.lang.String,java.lang.String> |
Fn.trimToNull() |
static <K,V> Function<java.util.Map.Entry<K,V>,V> |
Fn.value() |
Modifier and Type | Method and Description |
---|---|
<R> R |
DoubleStream.__(Function<? super DoubleStream,R> transfer)
Applies custom operator on stream.
|
<R> R |
EntryStream.__(Function<? super EntryStream<K,V>,R> transfer) |
<R> R |
IntStream.__(Function<? super IntStream,R> transfer)
Applies custom operator on stream.
|
<R> R |
LongStream.__(Function<? super LongStream,R> transfer)
Applies custom operator on stream.
|
<R> R |
Stream.__(Function<? super Stream<T>,R> transfer)
Applies custom operator on stream.
|
static <K,V,R> Function<java.util.Map.Entry<K,V>,R> |
Fn.applyByKey(Function<? super K,R> func) |
static <K,V,R> Function<java.util.Map.Entry<K,V>,R> |
Fn.applyByValue(Function<? super V,R> func) |
<K2,V2> EntryStream<K2,V2> |
EntryStream.chain(Function<? super Stream<java.util.Map.Entry<K,V>>,? extends Stream<java.util.Map.Entry<K2,V2>>> transfer) |
<K> Stream<java.util.List<T>> |
Stream.chunkBy(Function<? super T,? extends K> classifier)
Partitions
Stream into List s according to the given classifier function. |
static <T,A,IR,OR> |
Collectors.collectingAndThen(Collector<T,A,IR> c,
Function<IR,OR> finisher)
Returns a
Collector that performs additional transformation. |
static <T,U extends java.lang.Comparable> |
Fn.comparingBy(Function<? super T,? extends U> keyExtractor) |
static <T,U extends java.lang.Comparable> |
Comparators.comparingBy(Function<? super T,? extends U> keyExtractor) |
static <T,U> java.util.Comparator<T> |
Comparators.comparingBy(Function<? super T,? extends U> keyExtractor,
java.util.Comparator<? super U> keyComparator) |
EntryStream<K,V> |
EntryStream.distinctBy(Function<? super java.util.Map.Entry<K,V>,?> keyExtractor) |
<K> Stream<T> |
Stream.distinctBy(Function<? super T,? extends K> keyExtractor)
Returns
Stream with distinct elements (as determined by hashCode
and equals methods) according to the given classifier function. |
<R> Stream<R> |
Stream.flatArray(Function<? super T,? extends R[]> mapper) |
<R> Stream<R> |
Stream.flatCollection(Function<? super T,? extends java.util.Collection<? extends R>> mapper) |
<KK,VV> EntryStream<KK,VV> |
EntryStream.flatMap(Function<? super java.util.Map.Entry<K,V>,Stream<java.util.Map.Entry<KK,VV>>> mapper) |
<R> Stream<R> |
Stream.flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
<U> Optional<U> |
Optional.flatMap(Function<? super T,Optional<U>> mapper)
Invokes mapping function with
Optional result if value is present. |
<KK> EntryStream<KK,V> |
EntryStream.flatMapKey(Function<? super K,Stream<KK>> keyMapper) |
static <T,U,A,R> Collector<T,?,R> |
Collectors.flatMapping(Function<? super T,? extends Stream<? extends U>> mapper,
Collector<? super U,A,R> downstream)
Returns a
Collector that performs flat-mapping before accumulation. |
DoubleStream |
Stream.flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
<K,V> EntryStream<K,V> |
Stream.flatMapToEntry(Function<? super T,? extends Stream<? extends java.util.Map.Entry<K,V>>> mapper) |
IntStream |
Stream.flatMapToInt(Function<? super T,? extends IntStream> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
LongStream |
Stream.flatMapToLong(Function<? super T,? extends LongStream> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
<VV> EntryStream<K,VV> |
EntryStream.flatMapValue(Function<? super V,Stream<VV>> valueMapper) |
<K> Stream<java.util.Map.Entry<K,java.util.List<T>>> |
Stream.groupBy(Function<? super T,? extends K> classifier)
Partitions
Stream into Map entries according to the given classifier function. |
<K,A,D> Stream<java.util.Map.Entry<K,D>> |
Stream.groupBy(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream) |
<K,A,D> Stream<java.util.Map.Entry<K,D>> |
Stream.groupBy(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream,
Supplier<java.util.Map<K,D>> mapFactory) |
<K> EntryStream<K,java.util.List<T>> |
Stream.groupByToEntry(Function<? super T,? extends K> classifier) |
<K,A,D> EntryStream<K,D> |
Stream.groupByToEntry(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream) |
<K,A,D> EntryStream<K,D> |
Stream.groupByToEntry(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream,
Supplier<java.util.Map<K,D>> mapFactory) |
static <T,K> Collector<T,?,java.util.Map<K,java.util.List<T>>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier)
Returns a
Collector that performs grouping operation by given classifier. |
static <T,K,A,D> Collector<T,?,java.util.Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream)
Returns a
Collector that performs grouping operation by given classifier. |
static <T,K,D,A,M extends java.util.Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream,
Supplier<M> mapFactory)
Returns a
Collector that performs grouping operation by given classifier. |
<K> java.util.Map<K,java.util.List<T>> |
Stream.groupTo(Function<? super T,? extends K> classifier) |
<K,A,D> java.util.Map<K,D> |
Stream.groupTo(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream) |
<K,D,A,M extends java.util.Map<K,D>> |
Stream.groupTo(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream,
Supplier<M> mapFactory) |
<KK,VV> EntryStream<KK,VV> |
EntryStream.map(Function<? super K,KK> keyMapper,
Function<? super V,VV> valueMapper) |
<KK,VV> EntryStream<KK,VV> |
EntryStream.map(Function<? super K,KK> keyMapper,
Function<? super V,VV> valueMapper) |
<KK,VV> EntryStream<KK,VV> |
EntryStream.map(Function<? super java.util.Map.Entry<K,V>,java.util.Map.Entry<KK,VV>> mapper) |
<R> Stream<R> |
Stream.map(Function<? super T,? extends R> mapper)
Returns
Stream with elements that obtained by applying the given function. |
<U> Optional<U> |
Optional.map(Function<? super T,? extends U> mapper)
Invokes the given mapping function on inner value if present.
|
<KK> EntryStream<KK,V> |
EntryStream.mapKey(Function<? super K,KK> keyMapper) |
static <K,V,KK> Function<java.util.Map.Entry<K,V>,java.util.Map.Entry<KK,V>> |
Fn.mapKey(Function<? super K,KK> func) |
static <T,U,A,R> Collector<T,?,R> |
Collectors.mapping(Function<? super T,? extends U> mapper,
Collector<? super U,A,R> downstream)
Returns a
Collector that performs mapping before accumulation. |
<K,V> EntryStream<K,V> |
Stream.mapToEntry(Function<? super T,K> keyMapper,
Function<? super T,V> valueMapper) |
<K,V> EntryStream<K,V> |
Stream.mapToEntry(Function<? super T,K> keyMapper,
Function<? super T,V> valueMapper) |
<K,V> EntryStream<K,V> |
Stream.mapToEntry(Function<? super T,java.util.Map.Entry<K,V>> mapper) |
static <K,V,VV> Function<java.util.Map.Entry<K,V>,java.util.Map.Entry<K,VV>> |
Fn.mapValue(Function<? super V,VV> func) |
<VV> EntryStream<K,VV> |
EntryStream.mapValue(Function<? super V,VV> valueMapper) |
<U extends java.lang.Comparable<? super U>> |
Stream.maxBy(Function<? super T,U> keyExtractor) |
<U extends java.lang.Comparable<? super U>> |
Stream.minBy(Function<? super T,U> keyExtractor) |
static <K,T> EntryStream<K,T> |
EntryStream.of(java.util.Collection<? extends T> c,
Function<? super T,K> keyExtractor) |
static <K,T> EntryStream<K,T> |
EntryStream.of(T[] a,
Function<? super T,K> keyExtractor) |
static <T,R> Collector<T,?,R> |
Collectors.reducing(R identity,
Function<? super T,? extends R> mapper,
BinaryOperator<R> op)
Returns a
Collector that reduces input elements. |
static <T,U extends java.lang.Comparable> |
Fn.reversedComparingBy(Function<? super T,? extends U> keyExtractor) |
static <T,U extends java.lang.Comparable> |
Comparators.reversedComparingBy(Function<? super T,? extends U> keyExtractor) |
<U extends java.lang.Comparable<? super U>> |
EntryStream.sortedBy(Function<? super java.util.Map.Entry<K,V>,U> keyExtractor) |
<U extends java.lang.Comparable<? super U>> |
Stream.sortedBy(Function<? super T,U> keyExtractor)
Returns
Stream with sorted elements (as determinated by Comparable interface). |
<K> java.util.Map<K,T> |
Stream.toMap(Function<? super T,? extends K> keyMapper) |
static <K,T> Collector<T,?,java.util.Map<K,T>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper)
Returns a
Collector that fills new Map with input elements. |
<K,V> java.util.Map<K,V> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
<K,V> java.util.Map<K,V> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
Returns a
Collector that fills new Map with input elements. |
static <T,K,V> Collector<T,?,java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
Returns a
Collector that fills new Map with input elements. |
<K,V> java.util.Map<K,V> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
<K,V> java.util.Map<K,V> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V> Collector<T,?,java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V> Collector<T,?,java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
<K,V,M extends java.util.Map<K,V>> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<M> mapFactory) |
<K,V,M extends java.util.Map<K,V>> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<M> mapFactory) |
static <T,K,V,M extends java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<M> mapFactory)
Returns a
Collector that fills new Map with input elements. |
static <T,K,V,M extends java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<M> mapFactory)
Returns a
Collector that fills new Map with input elements. |
<K,V,M extends java.util.Map<K,V>> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<M> mapFactory) |
<K,V,M extends java.util.Map<K,V>> |
Stream.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<M> mapFactory) |
static <T,K,V,M extends java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<M> mapFactory) |
static <T,K,V,M extends java.util.Map<K,V>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<M> mapFactory) |
Modifier and Type | Interface and Description |
---|---|
interface |
UnaryOperator<T>
Operation on a single operand that produces a result of the
same type as its operand.
|