public class FlowImpl<T> extends Object implements Flow<T>
Stream.Builder<T>| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatch(Predicate<? super T> predicate) |
boolean |
anyMatch(Predicate<? super T> predicate) |
void |
close() |
<R,A> R |
collect(Collector<? super T,A,R> collector) |
<R> R |
collect(Supplier<R> supplier,
BiConsumer<R,? super T> accumulator,
BiConsumer<R,R> combiner) |
long |
count() |
FlowImpl<T> |
distinct() |
FlowImpl<T> |
filter(Predicate<? super T> predicate) |
Optional<T> |
findAny() |
Optional<T> |
findFirst() |
Optional<T> |
findLast()
Returns an
Optional describing the last element of this stream, or an empty Optional if the
stream is empty. |
<R> FlowImpl<R> |
flatMap(Function<? super T,? extends Stream<? extends R>> mapper) |
DoubleStream |
flatMapToDouble(Function<? super T,? extends DoubleStream> mapper) |
IntStream |
flatMapToInt(Function<? super T,? extends IntStream> mapper) |
LongStream |
flatMapToLong(Function<? super T,? extends LongStream> mapper) |
void |
forEach(Consumer<? super T> action) |
void |
forEachOrdered(Consumer<? super T> action) |
<K,V> Map<K,List<T>> |
groupBy(Function<T,K> transformation)
Equivalent to
collect(Collectors.groupingBy(transformation)). |
boolean |
isParallel() |
Iterator<T> |
iterator() |
FlowImpl<T> |
limit(long maxSize) |
<R> FlowImpl<R> |
map(Function<? super T,? extends R> mapper) |
DoubleStream |
mapToDouble(ToDoubleFunction<? super T> mapper) |
IntStream |
mapToInt(ToIntFunction<? super T> mapper) |
LongStream |
mapToLong(ToLongFunction<? super T> mapper) |
Optional<T> |
max(Comparator<? super T> comparator) |
Optional<T> |
min(Comparator<? super T> comparator) |
boolean |
noneMatch(Predicate<? super T> predicate) |
FlowImpl<T> |
onClose(Runnable closeHandler) |
FlowImpl<T> |
parallel() |
FlowImpl<T> |
peek(Consumer<? super T> action) |
Optional<T> |
reduce(BinaryOperator<T> accumulator) |
T |
reduce(T identity,
BinaryOperator<T> accumulator) |
<U> U |
reduce(U identity,
BiFunction<U,? super T,U> accumulator,
BinaryOperator<U> combiner) |
Flow<T> |
reverse()
Reverses the order of the elements in the flow.
|
FlowImpl<T> |
sequential() |
FlowImpl<T> |
skip(long n) |
FlowImpl<T> |
sorted() |
FlowImpl<T> |
sorted(Comparator<? super T> comparator) |
Spliterator<T> |
spliterator() |
Stream<T> |
stream()
Returns the wrapped stream.
|
Object[] |
toArray() |
<A> A[] |
toArray(IntFunction<A[]> generator) |
List<T> |
toList()
Equivalent to
collect(Collectors.toList()). |
<K,V> Map<K,V> |
toMap(Function<T,K> keyTransformation,
Function<T,V> valueTransformation)
Equivalent to
collect(Collectors.toMap(keyTransformation, valueTransformation)). |
Set<T> |
toSet()
Equivalent to
collect(Collectors.toSet()). |
FlowImpl<T> |
unordered() |
<R> Flow<T> |
withNonNull(Function<? super T,R> transformation)
Equivalent to
stream.filter(x -> transformation.apply(x) != null)). |
<R> Flow<T> |
withNull(Function<? super T,R> transformation)
Equivalent to
filter(x -> transformation.apply(x) == null). |
public Spliterator<T> spliterator()
spliterator in interface BaseStream<T,Stream<T>>public boolean isParallel()
isParallel in interface BaseStream<T,Stream<T>>public FlowImpl<T> sequential()
sequential in interface BaseStream<T,Stream<T>>public FlowImpl<T> unordered()
unordered in interface BaseStream<T,Stream<T>>public FlowImpl<T> onClose(Runnable closeHandler)
onClose in interface BaseStream<T,Stream<T>>public void close()
close in interface AutoCloseableclose 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 FlowImpl<T> sorted(Comparator<? super T> comparator)
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 <K,V> Map<K,V> toMap(Function<T,K> keyTransformation, Function<T,V> valueTransformation)
collect(Collectors.toMap(keyTransformation, valueTransformation)).public <R> Flow<T> withNonNull(Function<? super T,R> transformation)
stream.filter(x -> transformation.apply(x) != null)).withNonNull in interface Flow<T>public <R> Flow<T> withNull(Function<? super T,R> transformation)
filter(x -> transformation.apply(x) == null).public <K,V> Map<K,List<T>> groupBy(Function<T,K> transformation)
collect(Collectors.groupingBy(transformation)).Copyright © 2014–2016 Nikolche Mihajlovski and contributors. All rights reserved.