public class ExtendedStream<T> extends Object implements Stream<T>
Stream that provides some missed functions like
foldRight(java.util.function.BiFunction, Object), toList() and toSet()Stream.Builder<T>| Modifier | Constructor and Description |
|---|---|
protected |
ExtendedStream(Stream<T> delegate) |
public <R> R foldRight(BiFunction<T,R,R> accumulator, R identity)
public StreamableOptional<T> findLast()
public <R> ExtendedStream<R> map(Function<? super T,? extends R> mapper)
public <R> ExtendedStream<R> flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
public ExtendedStream<T> filter(Predicate<? super T> predicate)
public ExtendedStream<T> distinct()
public ExtendedStream<T> sorted()
public ExtendedStream<T> sorted(Comparator<? super T> comparator)
public ExtendedStream<T> peek(Consumer<? super T> action)
public ExtendedStream<T> limit(long maxSize)
public ExtendedStream<T> skip(long n)
public ExtendedStream<T> sequential()
sequential in interface BaseStream<T,Stream<T>>public ExtendedStream<T> parallel()
parallel in interface BaseStream<T,Stream<T>>public ExtendedStream<T> unordered()
unordered in interface BaseStream<T,Stream<T>>public ExtendedStream<T> onClose(Runnable closeHandler)
onClose in interface BaseStream<T,Stream<T>>public IntStream mapToInt(ToIntFunction<? super T> mapper)
public LongStream mapToLong(ToLongFunction<? super T> mapper)
public DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper)
mapToDouble in interface Stream<T>public IntStream flatMapToInt(Function<? super T,? extends IntStream> mapper)
flatMapToInt in interface Stream<T>public LongStream flatMapToLong(Function<? super T,? extends LongStream> mapper)
flatMapToLong in interface Stream<T>public DoubleStream flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
flatMapToDouble in interface Stream<T>public void forEachOrdered(Consumer<? super T> action)
forEachOrdered in interface Stream<T>public <A> A[] toArray(IntFunction<A[]> generator)
public T reduce(T identity, BinaryOperator<T> accumulator)
public Optional<T> reduce(BinaryOperator<T> accumulator)
public <U> U reduce(U identity,
BiFunction<U,? super T,U> accumulator,
BinaryOperator<U> combiner)
public <R> R collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)
public Optional<T> min(Comparator<? super T> comparator)
public Optional<T> max(Comparator<? super T> comparator)
public Spliterator<T> spliterator()
spliterator in interface BaseStream<T,Stream<T>>public boolean isParallel()
isParallel in interface BaseStream<T,Stream<T>>public void close()
close in interface AutoCloseableclose in interface BaseStream<T,Stream<T>>public static <T> ExtendedStream<T> of(Stream<T> stream)
Copyright © 2014–2015. All rights reserved.