Package org.silverpeas.core.util.stream
Class StreamWrapper<T>
- java.lang.Object
-
- org.silverpeas.core.util.stream.StreamWrapper<T>
-
- All Implemented Interfaces:
AutoCloseable
,BaseStream<T,Stream<T>>
,Stream<T>
- Direct Known Subclasses:
ReplacementList.FilterStream
public abstract class StreamWrapper<T> extends Object implements Stream<T>
- Author:
- silveryocha
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description StreamWrapper(Stream<T> stream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allMatch(Predicate<? super T> predicate)
boolean
anyMatch(Predicate<? super T> predicate)
static <T1> Stream.Builder<T1>
builder()
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)
static <T1> Stream<T1>
concat(Stream<? extends T1> a, Stream<? extends T1> b)
long
count()
Stream<T>
distinct()
static <T1> Stream<T1>
empty()
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)
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)
static <T1> Stream<T1>
generate(Supplier<T1> s)
boolean
isParallel()
static <T1> Stream<T1>
iterate(T1 seed, UnaryOperator<T1> f)
Iterator<T>
iterator()
Stream<T>
limit(long maxSize)
<R> Stream<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)
static <T1> Stream<T1>
of(T1 t1)
static <T1> Stream<T1>
of(T1... values)
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()
protected Stream<T>
stream()
Object[]
toArray()
<A> A[]
toArray(IntFunction<A[]> generator)
Stream<T>
unordered()
-
-
-
Method Detail
-
builder
public static <T1> Stream.Builder<T1> builder()
-
empty
public static <T1> Stream<T1> empty()
-
of
public static <T1> Stream<T1> of(T1 t1)
-
of
@SafeVarargs public static <T1> Stream<T1> of(T1... values)
-
iterate
public static <T1> Stream<T1> iterate(T1 seed, UnaryOperator<T1> f)
-
mapToInt
public IntStream mapToInt(ToIntFunction<? super T> mapper)
-
mapToLong
public LongStream mapToLong(ToLongFunction<? super T> mapper)
-
mapToDouble
public DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper)
- Specified by:
mapToDouble
in interfaceStream<T>
-
flatMapToInt
public IntStream 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>
-
flatMapToDouble
public DoubleStream flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
- Specified by:
flatMapToDouble
in interfaceStream<T>
-
sorted
public Stream<T> sorted(Comparator<? super T> comparator)
-
forEachOrdered
public void forEachOrdered(Consumer<? super T> action)
- Specified by:
forEachOrdered
in interfaceStream<T>
-
toArray
public <A> A[] toArray(IntFunction<A[]> generator)
-
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)
-
collect
public <R> R collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)
-
min
public Optional<T> min(Comparator<? super T> comparator)
-
max
public Optional<T> max(Comparator<? super T> comparator)
-
spliterator
public Spliterator<T> spliterator()
- Specified by:
spliterator
in interfaceBaseStream<T,Stream<T>>
-
isParallel
public boolean isParallel()
- Specified by:
isParallel
in interfaceBaseStream<T,Stream<T>>
-
sequential
public Stream<T> sequential()
- Specified by:
sequential
in interfaceBaseStream<T,Stream<T>>
-
unordered
public Stream<T> unordered()
- Specified by:
unordered
in interfaceBaseStream<T,Stream<T>>
-
onClose
public Stream<T> onClose(Runnable closeHandler)
- Specified by:
onClose
in interfaceBaseStream<T,Stream<T>>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<T,Stream<T>>
-
-