| Package | Description |
|---|---|
| com.annimon.stream |
| 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(Stream<? extends T> stream1,
Stream<? extends T> stream2)
Concatenates two streams.
|
Stream<T> |
Stream.distinct()
Returns
Stream with distinct elements (as determinated by hashCode and equals methods). |
Stream<T> |
Stream.dropWhile(Predicate<? super T> predicate)
Drops elements while the predicate is true and returns the rest.
|
static <T> Stream<T> |
Stream.empty()
Returns an empty stream.
|
Stream<T> |
Stream.filter(Predicate<? super T> predicate)
Returns
Stream with elements that satisfy the given predicate. |
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> |
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.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(T element)
If specified element is null, returns an empty
Stream,
otherwise returns a Stream containing a single element. |
static Stream<Integer> |
Stream.ofRange(int from,
int to)
Deprecated.
As of release 1.0.7, replaced by
range(int, int) |
static Stream<Long> |
Stream.ofRange(long from,
long to)
Deprecated.
As of release 1.0.7, replaced by
range(long, long) |
static Stream<Integer> |
Stream.ofRangeClosed(int from,
int to)
Deprecated.
As of release 1.0.7, replaced by
rangeClosed(int, int) |
static Stream<Long> |
Stream.ofRangeClosed(long from,
long to)
Deprecated.
As of release 1.0.7, replaced by
rangeClosed(long, long) |
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. |
<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.takeWhile(Predicate<? super T> predicate)
Takes elements while the predicate is true.
|
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 <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. |
Copyright © 2017. All rights reserved.