Package | Description |
---|---|
org.jooq.lambda |
This package contains useful extensions for interoperation with Java 8's lambda expressions and
FunctionalInterface types. |
Modifier and Type | Method and Description |
---|---|
default <U> Seq<U> |
Seq.cast(Class<U> type)
Cast all elements in a stream to a given type, possibly throwing a
ClassCastException . |
static <T,U> Seq<U> |
Seq.cast(java.util.stream.Stream<T> stream,
Class<U> type)
Cast all elements in a stream to a given type, possibly throwing a
ClassCastException . |
static <T> Seq<T> |
Seq.concat(java.util.stream.Stream<T>... streams)
Concatenate a number of streams.
|
default Seq<T> |
Seq.concat(java.util.stream.Stream<T> other)
Concatenate two streams.
|
default Seq<T> |
Seq.concat(T... other)
Concatenate two streams.
|
default Seq<T> |
Seq.concat(T other)
Concatenate two streams.
|
default Seq<T> |
Seq.cycle()
Repeat a stream infinitely.
|
static <T> Seq<T> |
Seq.cycle(java.util.stream.Stream<T> stream)
Repeat a stream infinitely.
|
Seq<T> |
Seq.distinct() |
static <T> Seq<T> |
Seq.empty() |
Seq<T> |
Seq.filter(java.util.function.Predicate<? super T> predicate) |
<R> Seq<R> |
Seq.flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> mapper) |
static Seq<Void> |
Seq.generate() |
static <T> Seq<T> |
Seq.generate(java.util.function.Supplier<T> s) |
static <T> Seq<T> |
Seq.generate(T value) |
static <T> Seq<T> |
Seq.intersperse(java.util.stream.Stream<T> stream,
T value)
Returns a stream with a given value interspersed between any two values of this stream.
|
default Seq<T> |
Seq.intersperse(T value)
Returns a stream with a given value interspersed between any two values of this stream.
|
static <T> Seq<T> |
Seq.iterate(T seed,
java.util.function.UnaryOperator<T> f) |
Seq<T> |
Seq.limit(long maxSize) |
static <T> Seq<T> |
Seq.limit(java.util.stream.Stream<T> stream,
long elements)
Returns a stream limited to n elements.
|
default Seq<T> |
Seq.limitUntil(java.util.function.Predicate<? super T> predicate)
Returns a stream limited to all elements for which a predicate evaluates to
false . |
static <T> Seq<T> |
Seq.limitUntil(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate)
Returns a stream limited to all elements for which a predicate evaluates to
true . |
default Seq<T> |
Seq.limitWhile(java.util.function.Predicate<? super T> predicate)
Returns a stream limited to all elements for which a predicate evaluates to
true . |
static <T> Seq<T> |
Seq.limitWhile(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate)
Returns a stream limited to all elements for which a predicate evaluates to
true . |
<R> Seq<R> |
Seq.map(java.util.function.Function<? super T,? extends R> mapper) |
static <T> Seq<T> |
Seq.of(T... values) |
static <T> Seq<T> |
Seq.of(T value) |
default <U> Seq<U> |
Seq.ofType(Class<U> type)
Keep only those elements in a stream that are of a given type.
|
static <T,U> Seq<U> |
Seq.ofType(java.util.stream.Stream<T> stream,
Class<U> type)
Keep only those elements in a stream that are of a given type.
|
Seq<T> |
Seq.onClose(Runnable closeHandler) |
default Seq<T> |
Seq.parallel() |
Seq<T> |
Seq.peek(java.util.function.Consumer<? super T> action) |
default Seq<T> |
Seq.reverse()
Reverse a stream.
|
static <T> Seq<T> |
Seq.reverse(java.util.stream.Stream<T> stream)
Reverse a stream.
|
static <T,U> Seq<U> |
Seq.scanLeft(java.util.stream.Stream<T> stream,
U seed,
java.util.function.BiFunction<U,? super T,U> function)
Scan a stream to the left.
|
default <U> Seq<U> |
Seq.scanLeft(U seed,
java.util.function.BiFunction<U,? super T,U> function)
Scan a stream to the left.
|
static <T,U> Seq<U> |
Seq.scanRight(java.util.stream.Stream<T> stream,
U seed,
java.util.function.BiFunction<? super T,U,U> function)
Scan a stream to the right.
|
default <U> Seq<U> |
Seq.scanRight(U seed,
java.util.function.BiFunction<? super T,U,U> function)
Scan a stream to the right.
|
static <T> Seq<T> |
Seq.seq(Iterable<T> iterable)
Wrap an Iterable into a Seq.
|
static <T> Seq<T> |
Seq.seq(Iterator<T> iterator)
Wrap an Iterator into a Seq.
|
static <K,V> Seq<Tuple2<K,V>> |
Seq.seq(Map<K,V> map)
Wrap a Map into a Seq.
|
static <T> Seq<T> |
Seq.seq(Optional<T> optional)
Wrap an Optional into a Seq.
|
static <T> Seq<T> |
SQL.seq(PreparedStatement stmt,
java.util.function.Function<ResultSet,T> rowFunction)
Obtain a stream from a JDBC
ResultSet that is obtained from a PreparedStatement with a row
mapping function. |
static <T> Seq<T> |
SQL.seq(PreparedStatement stmt,
java.util.function.Function<ResultSet,T> rowFunction,
java.util.function.Consumer<? super SQLException> exceptionTranslator)
Obtain a stream from a JDBC
ResultSet that is obtained from a PreparedStatement with a row
mapping function. |
static <T> Seq<T> |
SQL.seq(ResultSet rs,
java.util.function.Function<ResultSet,T> rowFunction)
Obtain a stream from a JDBC
ResultSet with a row mapping function. |
static <T> Seq<T> |
SQL.seq(ResultSet rs,
java.util.function.Function<ResultSet,T> rowFunction,
java.util.function.Consumer<? super SQLException> exceptionTranslator)
Obtain a stream from a JDBC
ResultSet with a row mapping function. |
static <T> Seq<T> |
Seq.seq(java.util.stream.Stream<T> stream)
Wrap a Stream into a Seq.
|
static <T> Seq<T> |
SQL.seq(java.util.function.Supplier<? extends ResultSet> supplier,
java.util.function.Function<ResultSet,T> rowFunction)
|
static <T> Seq<T> |
SQL.seq(java.util.function.Supplier<? extends ResultSet> supplier,
java.util.function.Function<ResultSet,T> rowFunction,
java.util.function.Consumer<? super SQLException> exceptionTranslator)
|
default Seq<T> |
Seq.sequential() |
default Seq<T> |
Seq.shuffle()
Shuffle a stream
// e.g. (2, 3, 1)
Seq.of(1, 2, 3).shuffle()
|
default Seq<T> |
Seq.shuffle(Random random)
Shuffle a stream using specified source of randomness
// e.g. (2, 3, 1)
Seq.of(1, 2, 3).shuffle(new Random())
|
static <T> Seq<T> |
Seq.shuffle(java.util.stream.Stream<T> stream)
Shuffle a stream
// e.g. (2, 3, 1)
Seq.of(1, 2, 3).shuffle()
|
static <T> Seq<T> |
Seq.shuffle(java.util.stream.Stream<T> stream,
Random random)
Shuffle a stream using specified source of randomness
// e.g. (2, 3, 1)
Seq.of(1, 2, 3).shuffle(new Random())
|
Seq<T> |
Seq.skip(long n) |
static <T> Seq<T> |
Seq.skip(java.util.stream.Stream<T> stream,
long elements)
Returns a stream with n elements skipped.
|
default Seq<T> |
Seq.skipUntil(java.util.function.Predicate<? super T> predicate)
Returns a stream with all elements skipped for which a predicate evaluates to
false . |
static <T> Seq<T> |
Seq.skipUntil(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate)
Returns a stream with all elements skipped for which a predicate evaluates to
false . |
default Seq<T> |
Seq.skipWhile(java.util.function.Predicate<? super T> predicate)
Returns a stream with all elements skipped for which a predicate evaluates to
true . |
static <T> Seq<T> |
Seq.skipWhile(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate)
Returns a stream with all elements skipped for which a predicate evaluates to
true . |
default Seq<T> |
Seq.slice(long from,
long to)
Returns a limited interval from a given Stream.
|
static <T> Seq<T> |
Seq.slice(java.util.stream.Stream<T> stream,
long from,
long to)
Returns a limited interval from a given Stream.
|
Seq<T> |
Seq.sorted() |
Seq<T> |
Seq.sorted(Comparator<? super T> comparator) |
static <T,U> Seq<T> |
Seq.unfold(U seed,
java.util.function.Function<U,Optional<Tuple2<T,U>>> unfolder)
Unfold a function into a stream.
|
default Seq<T> |
Seq.unordered() |
default <U> Seq<Tuple2<T,U>> |
Seq.zip(Seq<U> other)
Zip two streams into one.
|
default <U,R> Seq<R> |
Seq.zip(Seq<U> other,
java.util.function.BiFunction<T,U,R> zipper)
Zip two streams into one using a
BiFunction to produce resulting values. |
static <T1,T2> Seq<Tuple2<T1,T2>> |
Seq.zip(java.util.stream.Stream<T1> left,
java.util.stream.Stream<T2> right)
Zip two streams into one.
|
static <T1,T2,R> Seq<R> |
Seq.zip(java.util.stream.Stream<T1> left,
java.util.stream.Stream<T2> right,
java.util.function.BiFunction<T1,T2,R> zipper)
Zip two streams into one using a
BiFunction to produce resulting values. |
default Seq<Tuple2<T,Long>> |
Seq.zipWithIndex()
Zip a Stream with a corresponding Stream of indexes.
|
static <T> Seq<Tuple2<T,Long>> |
Seq.zipWithIndex(java.util.stream.Stream<T> stream)
Zip a Stream with a corresponding Stream of indexes.
|
Modifier and Type | Method and Description |
---|---|
default Tuple2<Seq<T>,Seq<T>> |
Seq.duplicate()
Duplicate a Streams into two equivalent Streams.
|
default Tuple2<Seq<T>,Seq<T>> |
Seq.duplicate()
Duplicate a Streams into two equivalent Streams.
|
static <T> Tuple2<Seq<T>,Seq<T>> |
Seq.duplicate(java.util.stream.Stream<T> stream)
Duplicate a Streams into two equivalent Streams.
|
static <T> Tuple2<Seq<T>,Seq<T>> |
Seq.duplicate(java.util.stream.Stream<T> stream)
Duplicate a Streams into two equivalent Streams.
|
default Tuple2<Seq<T>,Seq<T>> |
Seq.partition(java.util.function.Predicate<? super T> predicate)
Partition a stream into two given a predicate.
|
default Tuple2<Seq<T>,Seq<T>> |
Seq.partition(java.util.function.Predicate<? super T> predicate)
Partition a stream into two given a predicate.
|
static <T> Tuple2<Seq<T>,Seq<T>> |
Seq.partition(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate)
Partition a stream into two given a predicate.
|
static <T> Tuple2<Seq<T>,Seq<T>> |
Seq.partition(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate)
Partition a stream into two given a predicate.
|
default Tuple2<Seq<T>,Seq<T>> |
Seq.splitAt(long position)
Split a stream at a given position.
|
default Tuple2<Seq<T>,Seq<T>> |
Seq.splitAt(long position)
Split a stream at a given position.
|
static <T> Tuple2<Seq<T>,Seq<T>> |
Seq.splitAt(java.util.stream.Stream<T> stream,
long position)
Split a stream at a given position.
|
static <T> Tuple2<Seq<T>,Seq<T>> |
Seq.splitAt(java.util.stream.Stream<T> stream,
long position)
Split a stream at a given position.
|
default Tuple2<Optional<T>,Seq<T>> |
Seq.splitAtHead()
Split a stream at the head.
|
static <T> Tuple2<Optional<T>,Seq<T>> |
Seq.splitAtHead(java.util.stream.Stream<T> stream)
Split a stream at the head.
|
static <T1,T2> Tuple2<Seq<T1>,Seq<T2>> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream)
Unzip one Stream into two.
|
static <T1,T2> Tuple2<Seq<T1>,Seq<T2>> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream)
Unzip one Stream into two.
|
static <T1,T2,U1,U2> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream,
java.util.function.BiFunction<T1,T2,Tuple2<U1,U2>> unzipper)
Unzip one Stream into two.
|
static <T1,T2,U1,U2> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream,
java.util.function.BiFunction<T1,T2,Tuple2<U1,U2>> unzipper)
Unzip one Stream into two.
|
static <T1,T2,U1,U2> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream,
java.util.function.Function<T1,U1> leftUnzipper,
java.util.function.Function<T2,U2> rightUnzipper)
Unzip one Stream into two.
|
static <T1,T2,U1,U2> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream,
java.util.function.Function<T1,U1> leftUnzipper,
java.util.function.Function<T2,U2> rightUnzipper)
Unzip one Stream into two.
|
static <T1,T2,U1,U2> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream,
java.util.function.Function<Tuple2<T1,T2>,Tuple2<U1,U2>> unzipper)
Unzip one Stream into two.
|
static <T1,T2,U1,U2> |
Seq.unzip(java.util.stream.Stream<Tuple2<T1,T2>> stream,
java.util.function.Function<Tuple2<T1,T2>,Tuple2<U1,U2>> unzipper)
Unzip one Stream into two.
|
Modifier and Type | Method and Description |
---|---|
default <U> Seq<Tuple2<T,U>> |
Seq.zip(Seq<U> other)
Zip two streams into one.
|
default <U,R> Seq<R> |
Seq.zip(Seq<U> other,
java.util.function.BiFunction<T,U,R> zipper)
Zip two streams into one using a
BiFunction to produce resulting values. |
Copyright © 2015. All Rights Reserved.