public interface Sequence<T> extends Stream<T>
Stream.Builder<T>| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatch(Predicate<? super T> predicate) |
boolean |
anyMatch(Predicate<? super T> predicate) |
default T |
at(long index) |
default Sequence<T> |
chain(Stream<T> other) |
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() |
Sequence<T> |
distinct() |
default <K> Sequence<T> |
distinctBy(Function<? super T,? extends K> propertyMapper) |
default Sequence<T> |
drop(long howMany) |
default Sequence<T> |
dropWhile(Predicate<T> predicate) |
Sequence<T> |
filter(Predicate<? super T> predicate) |
Optional<T> |
findAny() |
Optional<T> |
findFirst() |
default T |
first() |
<R> Sequence<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 <T> Sequence<T> |
from(Iterator<T> iterator) |
static <T> Sequence<T> |
from(Stream<T> stream) |
boolean |
isParallel() |
Iterator<T> |
iterator() |
default T |
last() |
Sequence<T> |
limit(long maxSize) |
<R> Sequence<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) |
default Optional<T> |
maybeAt(long index) |
default Optional<T> |
maybeFirst() |
default Optional<T> |
maybeLast() |
default Optional<T> |
maybeNth(long count) |
default Optional<T> |
maybeOne() |
Optional<T> |
min(Comparator<? super T> comparator) |
boolean |
noneMatch(Predicate<? super T> predicate) |
default T |
nth(long count) |
Sequence<T> |
onClose(Runnable closeHandler) |
default T |
one() |
Sequence<T> |
parallel() |
Sequence<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) |
Sequence<T> |
sequential() |
Sequence<T> |
skip(long n) |
default Sequence<T> |
slice(long from,
long howMany) |
Sequence<T> |
sorted() |
Sequence<T> |
sorted(Comparator<? super T> comparator) |
Spliterator<T> |
spliterator() |
default Sequence<T> |
take(int howMany) |
default Sequence<T> |
takeAtMostLast(int howMany) |
default Sequence<T> |
takeLast(int howMany) |
default Sequence<T> |
takeWhile(Predicate<T> predicate) |
default Sequence<T> |
tap(Consumer<? super T> consumer) |
Object[] |
toArray() |
<A> A[] |
toArray(IntFunction<A[]> generator) |
default List<T> |
toList() |
default <K,U> Map<K,U> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper) |
default Set<T> |
toSet() |
Sequence<T> |
unordered() |
default <K,U> Map<K,U> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
default T first()
default T one()
default T last()
default T nth(long count)
default T at(long index)
void close()
close in interface AutoCloseableclose in interface BaseStream<T,Stream<T>><R> R collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)
DoubleStream flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
flatMapToDouble in interface Stream<T>IntStream flatMapToInt(Function<? super T,? extends IntStream> mapper)
flatMapToInt in interface Stream<T>LongStream flatMapToLong(Function<? super T,? extends LongStream> mapper)
flatMapToLong in interface Stream<T>void forEachOrdered(Consumer<? super T> action)
forEachOrdered in interface Stream<T>boolean isParallel()
isParallel in interface BaseStream<T,Stream<T>>DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper)
mapToDouble in interface Stream<T>IntStream mapToInt(ToIntFunction<? super T> mapper)
LongStream mapToLong(ToLongFunction<? super T> mapper)
Sequence<T> onClose(Runnable closeHandler)
onClose in interface BaseStream<T,Stream<T>>T reduce(T identity, BinaryOperator<T> accumulator)
Optional<T> reduce(BinaryOperator<T> accumulator)
<U> U reduce(U identity,
BiFunction<U,? super T,U> accumulator,
BinaryOperator<U> combiner)
Sequence<T> sequential()
sequential in interface BaseStream<T,Stream<T>>Sequence<T> sorted(Comparator<? super T> comparator)
Spliterator<T> spliterator()
spliterator in interface BaseStream<T,Stream<T>><A> A[] toArray(IntFunction<A[]> generator)
Copyright © 2017. All rights reserved.