Package | Description |
---|---|
io.vavr | |
io.vavr.collection |
Purely functional collections based on Traversable.
|
Modifier and Type | Method and Description |
---|---|
static <T> Stream<T> |
API.Stream()
Alias for
empty() |
static <T> Stream<T> |
API.Stream(T... elements)
Alias for
of(Object...) |
static <T> Stream<T> |
API.Stream(T element)
Alias for
of(Object) |
default Stream<T> |
Value.toStream()
Converts this to a
Stream . |
Modifier and Type | Class and Description |
---|---|
static class |
Stream.Cons<T>
Non-empty
Stream , consisting of a head , and tail . |
static class |
Stream.Empty<T>
The empty Stream.
|
Modifier and Type | Method and Description |
---|---|
default Stream<T> |
Stream.append(T element) |
default Stream<T> |
Stream.appendAll(Iterable<? extends T> elements) |
default Stream<T> |
Stream.appendSelf(Function<? super Stream<T>,? extends Stream<T>> mapper)
Appends itself to the end of stream with
mapper function. |
default Stream<T> |
Stream.asJava(Consumer<? super List<T>> action) |
default Stream<T> |
Stream.asJavaMutable(Consumer<? super List<T>> action) |
default <R> Stream<R> |
Stream.collect(PartialFunction<? super T,? extends R> partialFunction) |
default Stream<Stream<T>> |
Stream.combinations() |
default Stream<Stream<T>> |
Stream.combinations(int k) |
static <T> Stream<T> |
Stream.concat(Iterable<? extends Iterable<? extends T>> iterables)
Lazily creates a Stream in O(1) which traverses along the concatenation of the given iterables.
|
static <T> Stream<T> |
Stream.concat(Iterable<? extends T>... iterables)
Lazily creates a Stream in O(1) which traverses along the concatenation of the given iterables.
|
static <T> Stream<T> |
Stream.cons(T head,
Supplier<? extends Stream<? extends T>> tailSupplier)
Constructs a Stream of a head element and a tail supplier.
|
static <T> Stream<T> |
Stream.continually(Supplier<? extends T> supplier)
Generates an (theoretically) infinitely long Stream using a value Supplier.
|
static <T> Stream<T> |
Stream.continually(T t)
Repeats an element infinitely often.
|
default Stream<T> |
Stream.cycle()
Repeat the elements of this Stream infinitely.
|
default Stream<T> |
Stream.cycle(int count)
Repeat the elements of this Stream
count times. |
default Stream<T> |
Stream.distinct() |
default Stream<T> |
Stream.distinctBy(Comparator<? super T> comparator) |
default <U> Stream<T> |
Stream.distinctBy(Function<? super T,? extends U> keyExtractor) |
default Stream<T> |
Stream.drop(int n) |
default Stream<T> |
Stream.dropRight(int n) |
default Stream<T> |
Stream.dropRightUntil(Predicate<? super T> predicate) |
default Stream<T> |
Stream.dropRightWhile(Predicate<? super T> predicate) |
default Stream<T> |
Stream.dropUntil(Predicate<? super T> predicate) |
default Stream<T> |
Stream.dropWhile(Predicate<? super T> predicate) |
static <T> Stream<T> |
Stream.empty()
Returns the single instance of Nil.
|
default Stream<T> |
Stream.extend(Function<? super T,? extends T> nextFunction)
Extends (continues) this
Stream with a Stream of values created by applying
consecutively provided Function to the last element of the original Stream. |
default Stream<T> |
Stream.extend(Supplier<? extends T> nextSupplier)
Extends (continues) this
Stream with values provided by a Supplier |
default Stream<T> |
Stream.extend(T next)
Extends (continues) this
Stream with a constantly repeated value. |
static <T> Stream<T> |
Stream.fill(int n,
Supplier<? extends T> s)
Returns a Stream containing
n values supplied by a given Supplier s . |
default Stream<T> |
Stream.filter(Predicate<? super T> predicate) |
default <U> Stream<U> |
Stream.flatMap(Function<? super T,? extends Iterable<? extends U>> mapper) |
static Stream<Integer> |
Stream.from(int value)
Returns an infinitely long Stream of
int values starting from from . |
static Stream<Integer> |
Stream.from(int value,
int step)
Returns an infinite long Stream of
int values starting from value and spaced by step . |
static Stream<Long> |
Stream.from(long value)
Returns an infinitely long Stream of
long values starting from from . |
static Stream<Long> |
Stream.from(long value,
long step)
Returns an infinite long Stream of
long values starting from value and spaced by step . |
default Stream<T> |
Stream.init() |
default Stream<T> |
Stream.insert(int index,
T element) |
default Stream<T> |
Stream.insertAll(int index,
Iterable<? extends T> elements) |
default Stream<T> |
Stream.intersperse(T element) |
static <T> Stream<T> |
Stream.iterate(T seed,
Function<? super T,? extends T> f)
Generates a (theoretically) infinitely long Stream using a function to calculate the next value
based on the previous.
|
default Stream<T> |
Stream.leftPadTo(int length,
T element) |
default <U> Stream<U> |
Stream.map(Function<? super T,? extends U> mapper) |
static <T> Stream<T> |
Stream.narrow(Stream<? extends T> stream)
Narrows a widened
Stream<? extends T> to Stream<T>
by performing a type-safe cast. |
static <T> Stream<T> |
Stream.of(T... elements)
Creates a Stream of the given elements.
|
static <T> Stream<T> |
Stream.of(T element)
Returns a singleton
Stream , i.e. |
static Stream<Boolean> |
Stream.ofAll(boolean... elements)
Creates a Stream from boolean values.
|
static Stream<Byte> |
Stream.ofAll(byte... elements)
Creates a Stream from byte values.
|
static Stream<Character> |
Stream.ofAll(char... elements)
Creates a Stream from char values.
|
static Stream<Double> |
Stream.ofAll(double... elements)
Creates a Stream values double values.
|
static Stream<Float> |
Stream.ofAll(float... elements)
Creates a Stream from float values.
|
static Stream<Integer> |
Stream.ofAll(int... elements)
Creates a Stream from int values.
|
static <T> Stream<T> |
Stream.ofAll(Iterable<? extends T> elements)
Creates a Stream of the given elements.
|
static Stream<Long> |
Stream.ofAll(long... elements)
Creates a Stream from long values.
|
static Stream<Short> |
Stream.ofAll(short... elements)
Creates a Stream from short values.
|
static <T> Stream<T> |
Stream.ofAll(Stream<? extends T> javaStream)
Creates a Stream that contains the elements of the given
Stream . |
default Stream<T> |
Stream.orElse(Iterable<? extends T> other) |
default Stream<T> |
Stream.orElse(Supplier<? extends Iterable<? extends T>> supplier) |
default Stream<T> |
Stream.padTo(int length,
T element) |
default Stream<T> |
Stream.patch(int from,
Iterable<? extends T> that,
int replaced) |
default Stream<T> |
Stream.peek(Consumer<? super T> action) |
default Stream<Stream<T>> |
Stream.permutations() |
default Stream<T> |
Stream.prepend(T element) |
default Stream<T> |
Stream.prependAll(Iterable<? extends T> elements) |
static Stream<Character> |
Stream.range(char from,
char toExclusive) |
static Stream<Integer> |
Stream.range(int from,
int toExclusive)
Creates a Stream of int numbers starting from
from , extending to toExclusive - 1 . |
static Stream<Long> |
Stream.range(long from,
long toExclusive)
Creates a Stream of long numbers starting from
from , extending to toExclusive - 1 . |
static Stream<Character> |
Stream.rangeBy(char from,
char toExclusive,
int step) |
static Stream<Double> |
Stream.rangeBy(double from,
double toExclusive,
double step) |
static Stream<Integer> |
Stream.rangeBy(int from,
int toExclusive,
int step)
Creates a Stream of int numbers starting from
from , extending to toExclusive - 1 ,
with step . |
static Stream<Long> |
Stream.rangeBy(long from,
long toExclusive,
long step)
Creates a Stream of long numbers starting from
from , extending to toExclusive - 1 ,
with step . |
static Stream<Character> |
Stream.rangeClosed(char from,
char toInclusive) |
static Stream<Integer> |
Stream.rangeClosed(int from,
int toInclusive)
Creates a Stream of int numbers starting from
from , extending to toInclusive . |
static Stream<Long> |
Stream.rangeClosed(long from,
long toInclusive)
Creates a Stream of long numbers starting from
from , extending to toInclusive . |
static Stream<Character> |
Stream.rangeClosedBy(char from,
char toInclusive,
int step) |
static Stream<Double> |
Stream.rangeClosedBy(double from,
double toInclusive,
double step) |
static Stream<Integer> |
Stream.rangeClosedBy(int from,
int toInclusive,
int step)
Creates a Stream of int numbers starting from
from , extending to toInclusive ,
with step . |
static Stream<Long> |
Stream.rangeClosedBy(long from,
long toInclusive,
long step)
Creates a Stream of long numbers starting from
from , extending to toInclusive ,
with step . |
default Stream<T> |
Stream.remove(T element) |
default Stream<T> |
Stream.removeAll(Iterable<? extends T> elements) |
default Stream<T> |
Stream.removeAll(Predicate<? super T> predicate) |
default Stream<T> |
Stream.removeAll(T element) |
default Stream<T> |
Stream.removeAt(int index) |
default Stream<T> |
Stream.removeFirst(Predicate<T> predicate) |
default Stream<T> |
Stream.removeLast(Predicate<T> predicate) |
default Stream<T> |
Stream.replace(T currentElement,
T newElement) |
default Stream<T> |
Stream.replaceAll(T currentElement,
T newElement) |
default Stream<T> |
Stream.retainAll(Iterable<? extends T> elements) |
default Stream<T> |
Stream.reverse() |
default Stream<T> |
Stream.scan(T zero,
BiFunction<? super T,? super T,? extends T> operation) |
default <U> Stream<U> |
Stream.scanLeft(U zero,
BiFunction<? super U,? super T,? extends U> operation) |
default <U> Stream<U> |
Stream.scanRight(U zero,
BiFunction<? super T,? super U,? extends U> operation) |
default Stream<T> |
Stream.shuffle() |
default Stream<T> |
Stream.slice(int beginIndex,
int endIndex) |
default <U> Stream<T> |
Stream.sortBy(Comparator<? super U> comparator,
Function<? super T,? extends U> mapper) |
default <U extends Comparable<? super U>> |
Stream.sortBy(Function<? super T,? extends U> mapper) |
default Stream<T> |
Stream.sorted() |
default Stream<T> |
Stream.sorted(Comparator<? super T> comparator) |
default Stream<T> |
Stream.subSequence(int beginIndex) |
default Stream<T> |
Stream.subSequence(int beginIndex,
int endIndex) |
static <T> Stream<T> |
Stream.tabulate(int n,
Function<? super Integer,? extends T> f)
Returns a Stream containing
n values of a given Function f
over a range of integer values from 0 to n - 1 . |
Stream<T> |
Stream.tail() |
Stream<T> |
Stream.Empty.tail() |
default Stream<T> |
Stream.take(int n) |
default Stream<T> |
Stream.takeRight(int n) |
default Stream<T> |
Stream.takeUntil(Predicate<? super T> predicate) |
default Stream<T> |
Stream.takeWhile(Predicate<? super T> predicate) |
static <T> Stream<Stream<T>> |
Stream.transpose(Stream<Stream<T>> matrix)
Transposes the rows and columns of a
Stream matrix. |
static <T> Stream<T> |
Stream.unfold(T seed,
Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates a Stream from a seed value and a function.
|
static <T,U> Stream<U> |
Stream.unfoldLeft(T seed,
Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates a Stream from a seed value and a function.
|
static <T,U> Stream<U> |
Stream.unfoldRight(T seed,
Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates a Stream from a seed value and a function.
|
default Stream<T> |
Stream.update(int index,
Function<? super T,? extends T> updater) |
default Stream<T> |
Stream.update(int index,
T element) |
default <U> Stream<Tuple2<T,U>> |
Stream.zip(Iterable<? extends U> that) |
default <U> Stream<Tuple2<T,U>> |
Stream.zipAll(Iterable<? extends U> iterable,
T thisElem,
U thatElem) |
default <U,R> Stream<R> |
Stream.zipWith(Iterable<? extends U> that,
BiFunction<? super T,? super U,? extends R> mapper) |
default Stream<Tuple2<T,Integer>> |
Stream.zipWithIndex() |
default <U> Stream<U> |
Stream.zipWithIndex(BiFunction<? super T,? super Integer,? extends U> mapper) |
Modifier and Type | Method and Description |
---|---|
static <T> Collector<T,ArrayList<T>,Stream<T>> |
Stream.collector()
Returns a
Collector which may be used in conjunction with
Stream.collect(java.util.stream.Collector) to obtain a Stream . |
default Stream<Stream<T>> |
Stream.combinations() |
default Stream<Stream<T>> |
Stream.combinations(int k) |
default Iterator<Stream<T>> |
Stream.crossProduct(int power) |
default <C> Map<C,Stream<T>> |
Stream.groupBy(Function<? super T,? extends C> classifier) |
default Iterator<Stream<T>> |
Stream.grouped(int size) |
default Option<Stream<T>> |
Stream.initOption() |
default Tuple2<Stream<T>,Stream<T>> |
Stream.partition(Predicate<? super T> predicate) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.partition(Predicate<? super T> predicate) |
default Stream<Stream<T>> |
Stream.permutations() |
default Iterator<Stream<T>> |
Stream.slideBy(Function<? super T,?> classifier) |
default Iterator<Stream<T>> |
Stream.sliding(int size) |
default Iterator<Stream<T>> |
Stream.sliding(int size,
int step) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.span(Predicate<? super T> predicate) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.span(Predicate<? super T> predicate) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.splitAt(int n) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.splitAt(int n) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.splitAt(Predicate<? super T> predicate) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.splitAt(Predicate<? super T> predicate) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.splitAtInclusive(Predicate<? super T> predicate) |
default Tuple2<Stream<T>,Stream<T>> |
Stream.splitAtInclusive(Predicate<? super T> predicate) |
default Option<Stream<T>> |
Stream.tailOption() |
static <T> Stream<Stream<T>> |
Stream.transpose(Stream<Stream<T>> matrix)
Transposes the rows and columns of a
Stream matrix. |
default <T1,T2> Tuple2<Stream<T1>,Stream<T2>> |
Stream.unzip(Function<? super T,Tuple2<? extends T1,? extends T2>> unzipper) |
default <T1,T2> Tuple2<Stream<T1>,Stream<T2>> |
Stream.unzip(Function<? super T,Tuple2<? extends T1,? extends T2>> unzipper) |
default <T1,T2,T3> Tuple3<Stream<T1>,Stream<T2>,Stream<T3>> |
Stream.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper) |
default <T1,T2,T3> Tuple3<Stream<T1>,Stream<T2>,Stream<T3>> |
Stream.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper) |
default <T1,T2,T3> Tuple3<Stream<T1>,Stream<T2>,Stream<T3>> |
Stream.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper) |
Modifier and Type | Method and Description |
---|---|
static <T> Stream<T> |
Stream.narrow(Stream<? extends T> stream)
Narrows a widened
Stream<? extends T> to Stream<T>
by performing a type-safe cast. |
static <T> Stream<Stream<T>> |
Stream.transpose(Stream<Stream<T>> matrix)
Transposes the rows and columns of a
Stream matrix. |
Modifier and Type | Method and Description |
---|---|
default Stream<T> |
Stream.appendSelf(Function<? super Stream<T>,? extends Stream<T>> mapper)
Appends itself to the end of stream with
mapper function. |
default Stream<T> |
Stream.appendSelf(Function<? super Stream<T>,? extends Stream<T>> mapper)
Appends itself to the end of stream with
mapper function. |
static <T> Stream<T> |
Stream.cons(T head,
Supplier<? extends Stream<? extends T>> tailSupplier)
Constructs a Stream of a head element and a tail supplier.
|
default <U> U |
Stream.transform(Function<? super Stream<T>,? extends U> f)
Transforms this
Stream . |
static <T> Stream<Stream<T>> |
Stream.transpose(Stream<Stream<T>> matrix)
Transposes the rows and columns of a
Stream matrix. |
Copyright © 2017. All Rights Reserved.