Package com.gengoai.stream
Class ReusableJavaStream<T>
- java.lang.Object
-
- com.gengoai.stream.ReusableJavaStream<T>
-
- All Implemented Interfaces:
AutoCloseable
,BaseStream<T,Stream<T>>
,Stream<T>
public final class ReusableJavaStream<T> extends Object implements Stream<T>
- Author:
- David B. Bracewell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allMatch(Predicate<? super T> predicate)
boolean
anyMatch(Predicate<? super T> predicate)
void
close()
<R> R
collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)
<R,A>
Rcollect(Collector<? super T,A,R> collector)
long
count()
Stream<T>
distinct()
Stream<T>
filter(Predicate<? super T> predicate)
Optional<T>
findAny()
Optional<T>
findFirst()
<R> Stream<R>
flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
com.gengoai.stream.ReusableJavaDoubleStream
flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
com.gengoai.stream.ReusableJavaIntStream
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)
boolean
isParallel()
Iterator<T>
iterator()
Stream<T>
limit(long maxSize)
<R> Stream<R>
map(Function<? super T,? extends R> mapper)
com.gengoai.stream.ReusableJavaDoubleStream
mapToDouble(ToDoubleFunction<? super T> mapper)
com.gengoai.stream.ReusableJavaIntStream
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)
Stream<T>
onClose(Runnable closeHandler)
Stream<T>
parallel()
Stream<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)
Stream<T>
sequential()
Stream<T>
skip(long n)
Stream<T>
sorted()
Stream<T>
sorted(Comparator<? super T> comparator)
Spliterator<T>
spliterator()
Object[]
toArray()
<A> A[]
toArray(IntFunction<A[]> generator)
Stream<T>
unordered()
-
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<T,Stream<T>>
-
collect
public <R> R collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)
-
flatMapToDouble
public com.gengoai.stream.ReusableJavaDoubleStream flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
- Specified by:
flatMapToDouble
in interfaceStream<T>
-
flatMapToInt
public com.gengoai.stream.ReusableJavaIntStream flatMapToInt(Function<? super T,? extends IntStream> mapper)
- Specified by:
flatMapToInt
in interfaceStream<T>
-
flatMapToLong
public LongStream flatMapToLong(Function<? super T,? extends LongStream> mapper)
- Specified by:
flatMapToLong
in interfaceStream<T>
-
forEachOrdered
public void forEachOrdered(Consumer<? super T> action)
- Specified by:
forEachOrdered
in interfaceStream<T>
-
isParallel
public boolean isParallel()
- Specified by:
isParallel
in interfaceBaseStream<T,Stream<T>>
-
mapToDouble
public com.gengoai.stream.ReusableJavaDoubleStream mapToDouble(ToDoubleFunction<? super T> mapper)
- Specified by:
mapToDouble
in interfaceStream<T>
-
mapToInt
public com.gengoai.stream.ReusableJavaIntStream mapToInt(ToIntFunction<? super T> mapper)
-
mapToLong
public LongStream mapToLong(ToLongFunction<? super T> mapper)
-
max
public Optional<T> max(Comparator<? super T> comparator)
-
min
public Optional<T> min(Comparator<? super T> comparator)
-
onClose
public Stream<T> onClose(Runnable closeHandler)
- Specified by:
onClose
in interfaceBaseStream<T,Stream<T>>
-
reduce
public T reduce(T identity, BinaryOperator<T> accumulator)
-
reduce
public Optional<T> reduce(BinaryOperator<T> accumulator)
-
reduce
public <U> U reduce(U identity, BiFunction<U,? super T,U> accumulator, BinaryOperator<U> combiner)
-
sequential
public Stream<T> sequential()
- Specified by:
sequential
in interfaceBaseStream<T,Stream<T>>
-
sorted
public Stream<T> sorted(Comparator<? super T> comparator)
-
spliterator
public Spliterator<T> spliterator()
- Specified by:
spliterator
in interfaceBaseStream<T,Stream<T>>
-
toArray
public <A> A[] toArray(IntFunction<A[]> generator)
-
-