Class TCollectors
java.lang.Object
org.teavm.classlib.java.util.stream.TCollectors
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TCollector<T,
?, Double> averagingDouble
(ToDoubleFunction<? super T> mapper) static <T> TCollector<T,
?, Double> averagingInt
(ToIntFunction<? super T> mapper) static <T> TCollector<T,
?, Double> averagingLong
(ToLongFunction<? super T> mapper) static <T,
A, R, K> TCollector<T, A, K> collectingAndThen
(TCollector<T, A, R> downstream, Function<R, K> finisher) static <T> TCollector<T,
?, Long> counting()
static <T,
A, R> TCollector<T, ?, R> filtering
(Predicate<? super T> predicate, TCollector<? super T, A, R> downstream) static <T,
A, R, K> TCollector<T, ?, K> flatMapping
(Function<? super T, ? extends TStream<? extends A>> mapper, TCollector<? super A, R, K> downstream) static <E,
K> TCollector<E, ?, Map<K, List<E>>> groupingBy
(Function<? super E, ? extends K> keyExtractor) static <E,
K, V, I, M extends Map<K, V>>
TCollector<E,?, M> groupingBy
(Function<? super E, ? extends K> keyExtractor, Supplier<M> mapFactory, TCollector<? super E, I, V> downstream) static <E,
K, V, I> TCollector<E, ?, Map<K, V>> groupingBy
(Function<? super E, ? extends K> keyExtractor, TCollector<? super E, I, V> downstream) static TCollector<CharSequence,
?, String> joining()
static TCollector<CharSequence,
?, String> joining
(CharSequence delimiter) static TCollector<CharSequence,
?, String> joining
(CharSequence delimiter, CharSequence prefix, CharSequence suffix) static <T,
A, R, K> TCollector<T, ?, K> mapping
(Function<? super T, ? extends A> mapper, TCollector<? super A, R, K> downstream) static <T> TCollector<T,
?, Optional<T>> maxBy
(Comparator<? super T> comparator) static <T> TCollector<T,
?, Optional<T>> minBy
(Comparator<? super T> comparator) static <T> TCollector<T,
?, Map<Boolean, List<T>>> partitioningBy
(Predicate<? super T> predicate) static <T,
A, R> TCollector<T, ?, Map<Boolean, R>> partitioningBy
(Predicate<? super T> predicate, TCollector<? super T, A, R> downstream) static <T> TCollector<T,
?, Optional<T>> reducing
(BinaryOperator<T> op) static <T> TCollector<T,
?, T> reducing
(T identity, BinaryOperator<T> op) static <T,
U> TCollector<T, ?, U> reducing
(U identity, Function<? super T, ? extends U> mapper, BinaryOperator<U> op) static <T> TCollector<T,
?, TDoubleSummaryStatistics> summarizingDouble
(ToDoubleFunction<? super T> mapper) static <T> TCollector<T,
?, TIntSummaryStatistics> summarizingInt
(ToIntFunction<? super T> mapper) static <T> TCollector<T,
?, TLongSummaryStatistics> summarizingLong
(ToLongFunction<? super T> mapper) static <T> TCollector<T,
?, Double> summingDouble
(ToDoubleFunction<? super T> mapper) static <T> TCollector<T,
?, Integer> summingInt
(ToIntFunction<? super T> mapper) static <T> TCollector<T,
?, Long> summingLong
(ToLongFunction<? super T> mapper) static <T,
R1, R2, R>
TCollector<T,?, R> teeing
(TCollector<? super T, ?, R1> left, TCollector<? super T, ?, R2> right, BiFunction<? super R1, ? super R2, R> merger) static <T,
C extends Collection<T>>
TCollector<T,?, C> toCollection
(Supplier<C> collectionFactory) static <T> TCollector<T,
?, List<T>> toList()
static <E,
K, V> TCollector<E, ?, Map<K, V>> static <E,
K, V> TCollector<E, ?, Map<K, V>> toMap
(Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper, BinaryOperator<V> mergeFunction) static <E,
K, V, M extends Map<K, V>>
TCollector<E,?, M> toMap
(Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<M> mapFactory) static <T> TCollector<T,
?, Set<T>> toSet()
static <T> TCollector<T,
?, List<T>> static <E,
K, V> TCollector<E, ?, Map<K, V>> toUnmodifiableMap
(Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper) static <E,
K, V> TCollector<E, ?, Map<K, V>> toUnmodifiableMap
(Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper, BinaryOperator<V> mergeFunction) static <T> TCollector<T,
?, Set<T>>
-
Method Details
-
toCollection
public static <T,C extends Collection<T>> TCollector<T,?, toCollectionC> (Supplier<C> collectionFactory) -
toList
-
toUnmodifiableList
-
toSet
-
toUnmodifiableSet
-
joining
-
joining
-
joining
public static TCollector<CharSequence,?, joiningString> (CharSequence delimiter, CharSequence prefix, CharSequence suffix) -
mapping
public static <T,A, TCollector<T,R, K> ?, mappingK> (Function<? super T, ? extends A> mapper, TCollector<? super A, R, K> downstream) -
flatMapping
public static <T,A, TCollector<T,R, K> ?, flatMappingK> (Function<? super T, ? extends TStream<? extends A>> mapper, TCollector<? super A, R, K> downstream) -
filtering
public static <T,A, TCollector<T,R> ?, filteringR> (Predicate<? super T> predicate, TCollector<? super T, A, R> downstream) -
toMap
public static <E,K, TCollector<E,V> ?, toMapMap<K, V>> (Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper) -
toUnmodifiableMap
public static <E,K, TCollector<E,V> ?, toUnmodifiableMapMap<K, V>> (Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper) -
toMap
public static <E,K, TCollector<E,V> ?, toMapMap<K, V>> (Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper, BinaryOperator<V> mergeFunction) -
toUnmodifiableMap
public static <E,K, TCollector<E,V> ?, toUnmodifiableMapMap<K, V>> (Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper, BinaryOperator<V> mergeFunction) -
toMap
public static <E,K, TCollector<E,V, M extends Map<K, V>> ?, toMapM> (Function<? super E, ? extends K> keyMapper, Function<? super E, ? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<M> mapFactory) -
groupingBy
public static <E,K> TCollector<E,?, groupingByMap<K, List<E>>> (Function<? super E, ? extends K> keyExtractor) -
groupingBy
public static <E,K, TCollector<E,V, I> ?, groupingByMap<K, V>> (Function<? super E, ? extends K> keyExtractor, TCollector<? super E, I, V> downstream) -
groupingBy
public static <E,K, TCollector<E,V, I, M extends Map<K, V>> ?, groupingByM> (Function<? super E, ? extends K> keyExtractor, Supplier<M> mapFactory, TCollector<? super E, I, V> downstream) -
collectingAndThen
public static <T,A, TCollector<T,R, K> A, collectingAndThenK> (TCollector<T, A, R> downstream, Function<R, K> finisher) -
reducing
-
reducing
-
reducing
public static <T,U> TCollector<T,?, reducingU> (U identity, Function<? super T, ? extends U> mapper, BinaryOperator<U> op) -
minBy
-
maxBy
-
counting
-
summingInt
-
summingLong
-
summingDouble
-
averagingInt
-
averagingLong
-
averagingDouble
-
summarizingInt
public static <T> TCollector<T,?, summarizingIntTIntSummaryStatistics> (ToIntFunction<? super T> mapper) -
summarizingLong
public static <T> TCollector<T,?, summarizingLongTLongSummaryStatistics> (ToLongFunction<? super T> mapper) -
summarizingDouble
public static <T> TCollector<T,?, summarizingDoubleTDoubleSummaryStatistics> (ToDoubleFunction<? super T> mapper) -
teeing
public static <T,R1, TCollector<T,R2, R> ?, teeingR> (TCollector<? super T, ?, R1> left, TCollector<? super T, ?, R2> right, BiFunction<? super R1, ? super R2, R> merger) -
partitioningBy
public static <T,A, TCollector<T,R> ?, partitioningByMap<Boolean, R>> (Predicate<? super T> predicate, TCollector<? super T, A, R> downstream) -
partitioningBy
public static <T> TCollector<T,?, partitioningByMap<Boolean, List<T>>> (Predicate<? super T> predicate)
-