| Package | Description |
|---|---|
| com.annimon.stream | |
| com.annimon.stream.operator |
| Modifier and Type | Method and Description |
|---|---|
Stream<Long> |
LongStream.boxed()
Returns a
Stream consisting of the elements of this stream,
each boxed to an Long. |
Stream<Integer> |
IntStream.boxed()
Returns a
Stream consisting of the elements of this stream,
each boxed to an Integer. |
Stream<Double> |
DoubleStream.boxed()
Returns a
Stream consisting of the elements of this stream,
each boxed to an Double. |
<K> Stream<List<T>> |
Stream.chunkBy(Function<? super T,? extends K> classifier)
Partitions
Stream into Lists according to the given classifier function. |
static <T> Stream<T> |
Stream.concat(Iterator<? extends T> iterator1,
Iterator<? extends T> iterator2)
Concatenates two iterators to a stream.
|
static <T> Stream<T> |
Stream.concat(Stream<? extends T> stream1,
Stream<? extends T> stream2)
Concatenates two streams.
|
Stream<T> |
Stream.distinct()
Returns
Stream with distinct elements (as determined by hashCode and equals methods). |
<K> Stream<T> |
Stream.distinctBy(Function<? super T,? extends K> classifier)
Returns
Stream with distinct elements (as determined by hashCode
and equals methods) according to the given classifier function. |
Stream<T> |
Stream.dropWhile(Predicate<? super T> predicate)
Drops elements while the predicate is true, then returns the rest.
|
Stream<T> |
Stream.dropWhileIndexed(IndexedPredicate<? super T> predicate)
Drops elements while the
IndexedPredicate is true, then returns the rest. |
Stream<T> |
Stream.dropWhileIndexed(int from,
int step,
IndexedPredicate<? super T> predicate)
Drops elements while the
IndexedPredicate is true, then returns the rest. |
static <T> Stream<T> |
Stream.empty()
Returns an empty stream.
|
Stream<T> |
Stream.equalsOnly(T object)
Returns
Stream with elements that is equality of object only. |
Stream<T> |
Stream.filter(Predicate<? super T> predicate)
Returns
Stream with elements that satisfy the given predicate. |
Stream<T> |
Stream.filterIndexed(IndexedPredicate<? super T> predicate)
Returns a
Stream with elements that satisfy the given IndexedPredicate. |
Stream<T> |
Stream.filterIndexed(int from,
int step,
IndexedPredicate<? super T> predicate)
Returns a
Stream with elements that satisfy the given IndexedPredicate. |
Stream<T> |
Stream.filterNot(Predicate<? super T> predicate)
Returns
Stream with elements that does not satisfy the given predicate. |
<R> Stream<R> |
Stream.flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
static <T> Stream<T> |
Stream.generate(Supplier<T> supplier)
Creates a
Stream by elements that generated by Supplier. |
<K> Stream<Map.Entry<K,List<T>>> |
Stream.groupBy(Function<? super T,? extends K> classifier)
Partitions
Stream into Map entries according to the given classifier function. |
Stream<IntPair<T>> |
Stream.indexed()
Returns
Stream with indexed elements. |
Stream<IntPair<T>> |
Stream.indexed(int from,
int step)
Returns
Stream with indexed elements. |
static <T> Stream<T> |
Stream.iterate(T seed,
Predicate<? super T> predicate,
UnaryOperator<T> op)
Creates a
Stream by iterative application UnaryOperator function
to an initial element seed, conditioned on satisfying the supplied predicate. |
static <T> Stream<T> |
Stream.iterate(T seed,
UnaryOperator<T> op)
Creates a
Stream by iterative application UnaryOperator function
to an initial element seed. |
Stream<T> |
Stream.limit(long maxSize)
Returns
Stream with first maxSize elements. |
<R> Stream<R> |
Stream.map(Function<? super T,? extends R> mapper)
Returns
Stream with elements that obtained by applying the given function. |
<R> Stream<R> |
Stream.mapIndexed(IndexedFunction<? super T,? extends R> mapper)
Returns a
Stream with elements that obtained by applying the given IndexedFunction. |
<R> Stream<R> |
Stream.mapIndexed(int from,
int step,
IndexedFunction<? super T,? extends R> mapper)
Returns a
Stream with elements that obtained by applying the given IndexedFunction. |
<R> Stream<R> |
DoubleStream.mapToObj(DoubleFunction<? extends R> mapper)
Returns a
Stream consisting of the results of applying the given
function to the elements of this stream. |
<R> Stream<R> |
IntStream.mapToObj(IntFunction<? extends R> mapper)
Returns a
Stream consisting of the results of applying the given
function to the elements of this stream. |
<R> Stream<R> |
LongStream.mapToObj(LongFunction<? extends R> mapper)
Returns a
Stream consisting of the results of applying the given
function to the elements of this stream. |
static <T> Stream<T> |
Stream.merge(Iterator<? extends T> iterator1,
Iterator<? extends T> iterator2,
BiFunction<? super T,? super T,ObjMerge.MergeResult> selector)
Merges elements of two iterators according to the supplied selector function.
|
static <T> Stream<T> |
Stream.merge(Stream<? extends T> stream1,
Stream<? extends T> stream2,
BiFunction<? super T,? super T,ObjMerge.MergeResult> selector)
Merges elements of two streams according to the supplied selector function.
|
Stream<T> |
Stream.nullsOnly()
Returns
Stream with elements that is null only. |
static <T> Stream<T> |
Stream.of(Iterable<? extends T> iterable)
Creates a
Stream from any class that implements Iterable interface. |
static <T> Stream<T> |
Stream.of(Iterator<? extends T> iterator)
Creates a
Stream from any class that implements Iterator interface. |
static <K,V> Stream<Map.Entry<K,V>> |
Stream.of(Map<K,V> map)
Creates a
Stream from Map entries. |
static <T> Stream<T> |
Stream.of(T... elements)
Creates a
Stream from the specified values. |
static <T> Stream<T> |
Stream.ofNullable(Iterable<? extends T> iterable)
If specified iterable is null, returns an empty
Stream,
otherwise returns a Stream containing elements of this iterable. |
static <T> Stream<T> |
Stream.ofNullable(Iterator<? extends T> iterator)
If specified iterator is null, returns an empty
Stream,
otherwise returns a Stream containing entries of this iterator. |
static <K,V> Stream<Map.Entry<K,V>> |
Stream.ofNullable(Map<K,V> map)
If specified map is null, returns an empty
Stream,
otherwise returns a Stream containing entries of this map. |
static <T> Stream<T> |
Stream.ofNullable(T element)
If specified element is null, returns an empty
Stream,
otherwise returns a Stream containing a single element. |
static <T> Stream<T> |
Stream.ofNullable(T[] array)
If specified array is null, returns an empty
Stream,
otherwise returns a Stream containing elements of this array. |
Stream<T> |
Stream.onClose(Runnable closeHandler)
Adds close handler to the current stream.
|
Stream<T> |
Stream.peek(Consumer<? super T> action)
Performs provided action on each element.
|
static Stream<Integer> |
Stream.range(int from,
int to)
Creates a
Stream<Integer> from not closed range
(from from inclusive to to exclusive and incremental step 1). |
static Stream<Long> |
Stream.range(long from,
long to)
Creates a
Stream<Long> from not closed range
(from from inclusive to to exclusive and incremental step 1). |
static Stream<Integer> |
Stream.rangeClosed(int from,
int to)
Creates a
Stream<Integer> from closed range
(from from inclusive to to inclusive and incremental step 1). |
static Stream<Long> |
Stream.rangeClosed(long from,
long to)
Creates a
Stream<Long> from closed range
(from from inclusive to to inclusive and incremental step 1). |
Stream<T> |
Stream.sample(int stepWidth)
Samples the
Stream by emitting every n-th element. |
Stream<T> |
Stream.scan(BiFunction<T,T,T> accumulator)
Returns a
Stream produced by iterative application of a accumulation function
to reduction value and next element of the current stream. |
<R> Stream<R> |
Stream.scan(R identity,
BiFunction<? super R,? super T,? extends R> accumulator)
Returns a
Stream produced by iterative application of a accumulation function
to an initial element identity and next element of the current stream. |
<TT> Stream<TT> |
Stream.select(Class<TT> clazz)
Returns a stream consisting of the elements of this stream which are
instances of given class.
|
Stream<T> |
Stream.skip(long n)
Skips first
n elements and returns Stream with remaining elements. |
Stream<List<T>> |
Stream.slidingWindow(int windowSize)
Partitions
Stream into Lists of fixed size by sliding over the elements of the stream. |
Stream<List<T>> |
Stream.slidingWindow(int windowSize,
int stepWidth)
Partitions
Stream into Lists of fixed size by sliding over the elements of the stream. |
<R extends Comparable<? super R>> |
Stream.sortBy(Function<? super T,? extends R> f)
Returns
Stream with sorted elements (as determinated by Comparable interface). |
Stream<T> |
Stream.sorted()
Returns
Stream with sorted elements (as determinated by Comparable interface). |
Stream<T> |
Stream.sorted(Comparator<? super T> comparator)
Returns
Stream with sorted elements (as determinated by provided Comparator). |
Stream<T> |
Optional.stream()
Wraps a value into
Stream if present, otherwise returns an empty Stream. |
Stream<T> |
Stream.takeUntil(Predicate<? super T> stopPredicate)
Takes elements while the predicate returns
false. |
Stream<T> |
Stream.takeUntilIndexed(IndexedPredicate<? super T> stopPredicate)
Takes elements while the
IndexedPredicate returns false. |
Stream<T> |
Stream.takeUntilIndexed(int from,
int step,
IndexedPredicate<? super T> stopPredicate)
Takes elements while the
IndexedPredicate returns false. |
Stream<T> |
Stream.takeWhile(Predicate<? super T> predicate)
Takes elements while the predicate returns
true. |
Stream<T> |
Stream.takeWhileIndexed(IndexedPredicate<? super T> predicate)
Takes elements while the
IndexedPredicate returns true. |
Stream<T> |
Stream.takeWhileIndexed(int from,
int step,
IndexedPredicate<? super T> predicate)
Takes elements while the
IndexedPredicate returns true. |
Stream<T> |
Stream.withoutNulls()
Returns
Stream without null elements. |
static <F,S,R> Stream<R> |
Stream.zip(Iterator<? extends F> iterator1,
Iterator<? extends S> iterator2,
BiFunction<? super F,? super S,? extends R> combiner)
Combines two iterators to a stream by applying specified combiner function to each element at same position.
|
static <F,S,R> Stream<R> |
Stream.zip(Stream<? extends F> stream1,
Stream<? extends S> stream2,
BiFunction<? super F,? super S,? extends R> combiner)
Combines two streams by applying specified combiner function to each element at same position.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Stream<T> |
Stream.concat(Stream<? extends T> stream1,
Stream<? extends T> stream2)
Concatenates two streams.
|
static <T> Stream<T> |
Stream.concat(Stream<? extends T> stream1,
Stream<? extends T> stream2)
Concatenates two streams.
|
static <T> Stream<T> |
Stream.merge(Stream<? extends T> stream1,
Stream<? extends T> stream2,
BiFunction<? super T,? super T,ObjMerge.MergeResult> selector)
Merges elements of two streams according to the supplied selector function.
|
static <T> Stream<T> |
Stream.merge(Stream<? extends T> stream1,
Stream<? extends T> stream2,
BiFunction<? super T,? super T,ObjMerge.MergeResult> selector)
Merges elements of two streams according to the supplied selector function.
|
static <F,S,R> Stream<R> |
Stream.zip(Stream<? extends F> stream1,
Stream<? extends S> stream2,
BiFunction<? super F,? super S,? extends R> combiner)
Combines two streams by applying specified combiner function to each element at same position.
|
static <F,S,R> Stream<R> |
Stream.zip(Stream<? extends F> stream1,
Stream<? extends S> stream2,
BiFunction<? super F,? super S,? extends R> combiner)
Combines two streams by applying specified combiner function to each element at same position.
|
| Modifier and Type | Method and Description |
|---|---|
<R> R |
Stream.custom(Function<Stream<T>,R> function)
Applies custom operator on stream.
|
<R> Stream<R> |
Stream.flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
static <T,U,A,R> Collector<T,?,R> |
Collectors.flatMapping(Function<? super T,? extends Stream<? extends U>> mapper,
Collector<? super U,A,R> downstream)
Returns a
Collector that performs flat-mapping before accumulation. |
| Constructor and Description |
|---|
ObjFlatMap(Iterator<? extends T> iterator,
Function<? super T,? extends Stream<? extends R>> mapper) |
Copyright © 2018. All rights reserved.