public abstract class AbstractObjectStream<T> extends java.lang.Object implements ObjectStream<T>
Base class to make ObjectStream
s easier to implement.
Modifier and Type | Field and Description |
---|---|
protected java.util.stream.Stream<T> |
stream |
Constructor and Description |
---|
AbstractObjectStream() |
Modifier and Type | Method and Description |
---|---|
boolean |
allMatch(java.util.function.Predicate<? super T> predicate) |
boolean |
anyMatch(java.util.function.Predicate<? super T> predicate) |
void |
close()
No-op implementation of the
ObjectStream.close() method. |
<R,A> R |
collect(java.util.stream.Collector<? super T,A,R> collector) |
<R> R |
collect(java.util.function.Supplier<R> supplier,
java.util.function.BiConsumer<R,? super T> accumulator,
java.util.function.BiConsumer<R,R> combiner) |
long |
count() |
java.util.stream.Stream<T> |
distinct() |
java.util.stream.Stream<T> |
filter(java.util.function.Predicate<? super T> predicate) |
java.util.Optional<T> |
findAny() |
java.util.Optional<T> |
findFirst() |
<R> java.util.stream.Stream<R> |
flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> mapper) |
java.util.stream.DoubleStream |
flatMapToDouble(java.util.function.Function<? super T,? extends java.util.stream.DoubleStream> mapper) |
java.util.stream.IntStream |
flatMapToInt(java.util.function.Function<? super T,? extends java.util.stream.IntStream> mapper) |
java.util.stream.LongStream |
flatMapToLong(java.util.function.Function<? super T,? extends java.util.stream.LongStream> mapper) |
void |
forEach(java.util.function.Consumer<? super T> action) |
void |
forEachOrdered(java.util.function.Consumer<? super T> action) |
boolean |
isParallel() |
java.util.Iterator<T> |
iterator()
Get the iterator.
|
java.util.stream.Stream<T> |
limit(long maxSize) |
<R> java.util.stream.Stream<R> |
map(java.util.function.Function<? super T,? extends R> mapper) |
java.util.stream.DoubleStream |
mapToDouble(java.util.function.ToDoubleFunction<? super T> mapper) |
java.util.stream.IntStream |
mapToInt(java.util.function.ToIntFunction<? super T> mapper) |
java.util.stream.LongStream |
mapToLong(java.util.function.ToLongFunction<? super T> mapper) |
java.util.Optional<T> |
max(java.util.Comparator<? super T> comparator) |
java.util.Optional<T> |
min(java.util.Comparator<? super T> comparator) |
boolean |
noneMatch(java.util.function.Predicate<? super T> predicate) |
java.util.stream.Stream<T> |
onClose(java.lang.Runnable closeHandler) |
java.util.stream.Stream<T> |
parallel() |
java.util.stream.Stream<T> |
peek(java.util.function.Consumer<? super T> action) |
java.util.Optional<T> |
reduce(java.util.function.BinaryOperator<T> accumulator) |
T |
reduce(T identity,
java.util.function.BinaryOperator<T> accumulator) |
<U> U |
reduce(U identity,
java.util.function.BiFunction<U,? super T,U> accumulator,
java.util.function.BinaryOperator<U> combiner) |
java.util.stream.Stream<T> |
sequential() |
java.util.stream.Stream<T> |
skip(long n) |
java.util.stream.Stream<T> |
sorted() |
java.util.stream.Stream<T> |
sorted(java.util.Comparator<? super T> comparator) |
java.util.Spliterator<T> |
spliterator() |
java.lang.Object[] |
toArray() |
<A> A[] |
toArray(java.util.function.IntFunction<A[]> generator) |
java.util.stream.Stream<T> |
unordered() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readObject
protected java.util.stream.Stream<T> stream
public void close()
No-op implementation of the ObjectStream.close()
method.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.util.stream.BaseStream<T,java.util.stream.Stream<T>>
close
in interface ObjectStream<T>
public java.util.Iterator<T> iterator()
Get the iterator. This method just returns this
, so for-each loops can be used over streams.
public java.util.stream.Stream<T> filter(java.util.function.Predicate<? super T> predicate)
filter
in interface java.util.stream.Stream<T>
public <R> java.util.stream.Stream<R> map(java.util.function.Function<? super T,? extends R> mapper)
map
in interface java.util.stream.Stream<T>
public java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super T> mapper)
mapToInt
in interface java.util.stream.Stream<T>
public java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super T> mapper)
mapToLong
in interface java.util.stream.Stream<T>
public java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super T> mapper)
mapToDouble
in interface java.util.stream.Stream<T>
public <R> java.util.stream.Stream<R> flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> mapper)
flatMap
in interface java.util.stream.Stream<T>
public java.util.stream.IntStream flatMapToInt(java.util.function.Function<? super T,? extends java.util.stream.IntStream> mapper)
flatMapToInt
in interface java.util.stream.Stream<T>
public java.util.stream.LongStream flatMapToLong(java.util.function.Function<? super T,? extends java.util.stream.LongStream> mapper)
flatMapToLong
in interface java.util.stream.Stream<T>
public java.util.stream.DoubleStream flatMapToDouble(java.util.function.Function<? super T,? extends java.util.stream.DoubleStream> mapper)
flatMapToDouble
in interface java.util.stream.Stream<T>
public java.util.stream.Stream<T> distinct()
distinct
in interface java.util.stream.Stream<T>
public java.util.stream.Stream<T> sorted()
sorted
in interface java.util.stream.Stream<T>
public java.util.stream.Stream<T> sorted(java.util.Comparator<? super T> comparator)
sorted
in interface java.util.stream.Stream<T>
public java.util.stream.Stream<T> peek(java.util.function.Consumer<? super T> action)
peek
in interface java.util.stream.Stream<T>
public java.util.stream.Stream<T> limit(long maxSize)
limit
in interface java.util.stream.Stream<T>
public java.util.stream.Stream<T> skip(long n)
skip
in interface java.util.stream.Stream<T>
public void forEach(java.util.function.Consumer<? super T> action)
forEach
in interface java.lang.Iterable<T>
forEach
in interface java.util.stream.Stream<T>
forEach
in interface ObjectStream<T>
public void forEachOrdered(java.util.function.Consumer<? super T> action)
forEachOrdered
in interface java.util.stream.Stream<T>
public java.lang.Object[] toArray()
toArray
in interface java.util.stream.Stream<T>
public <A> A[] toArray(java.util.function.IntFunction<A[]> generator)
toArray
in interface java.util.stream.Stream<T>
public T reduce(T identity, java.util.function.BinaryOperator<T> accumulator)
reduce
in interface java.util.stream.Stream<T>
public java.util.Optional<T> reduce(java.util.function.BinaryOperator<T> accumulator)
reduce
in interface java.util.stream.Stream<T>
public <U> U reduce(U identity, java.util.function.BiFunction<U,? super T,U> accumulator, java.util.function.BinaryOperator<U> combiner)
reduce
in interface java.util.stream.Stream<T>
public <R> R collect(java.util.function.Supplier<R> supplier, java.util.function.BiConsumer<R,? super T> accumulator, java.util.function.BiConsumer<R,R> combiner)
collect
in interface java.util.stream.Stream<T>
public <R,A> R collect(java.util.stream.Collector<? super T,A,R> collector)
collect
in interface java.util.stream.Stream<T>
public java.util.Optional<T> min(java.util.Comparator<? super T> comparator)
min
in interface java.util.stream.Stream<T>
public java.util.Optional<T> max(java.util.Comparator<? super T> comparator)
max
in interface java.util.stream.Stream<T>
public long count()
count
in interface java.util.stream.Stream<T>
public boolean anyMatch(java.util.function.Predicate<? super T> predicate)
anyMatch
in interface java.util.stream.Stream<T>
public boolean allMatch(java.util.function.Predicate<? super T> predicate)
allMatch
in interface java.util.stream.Stream<T>
public boolean noneMatch(java.util.function.Predicate<? super T> predicate)
noneMatch
in interface java.util.stream.Stream<T>
public java.util.Optional<T> findFirst()
findFirst
in interface java.util.stream.Stream<T>
public java.util.Optional<T> findAny()
findAny
in interface java.util.stream.Stream<T>
public java.util.Spliterator<T> spliterator()
spliterator
in interface java.lang.Iterable<T>
spliterator
in interface java.util.stream.BaseStream<T,java.util.stream.Stream<T>>
spliterator
in interface ObjectStream<T>
public boolean isParallel()
public java.util.stream.Stream<T> sequential()
public java.util.stream.Stream<T> parallel()
public java.util.stream.Stream<T> unordered()