@FunctionalInterface public interface BiSequence<L,R> extends java.lang.Iterable<Pair<L,R>>
Iterable sequence of elements with Stream-like operations for refining, transforming and
collating the list of elements.| Modifier and Type | Method and Description |
|---|---|
default boolean |
all(java.util.function.BiPredicate<? super L,? super R> biPredicate) |
default boolean |
any(java.util.function.BiPredicate<? super L,? super R> biPredicate) |
default BiSequence<L,R> |
append(java.lang.Iterable<? extends Pair<L,R>> that)
Append the elements of the given
Iterable to the end of this BiSequence. |
default BiSequence<L,R> |
append(java.util.Iterator<? extends Pair<L,R>> iterator)
Append the elements of the given
Iterator to the end of this BiSequence. |
default BiSequence<L,R> |
append(Pair<L,R>... entries)
Append the given elements to the end of this
BiSequence. |
default BiSequence<L,R> |
append(java.util.stream.Stream<Pair<L,R>> stream)
Append the elements of the given
Stream to the end of this BiSequence. |
default BiSequence<L,R> |
appendPair(L left,
R right)
Append the given pair to the end of this
BiSequence. |
default Sequence<BiSequence<L,R>> |
batch(java.util.function.BiPredicate<? super Pair<L,R>,? super Pair<L,R>> predicate)
Batch the elements of this
BiSequence into a sequence of BiSequences of distinct elements, where
the given predicate determines where to split the lists of partitioned elements. |
default Sequence<BiSequence<L,R>> |
batch(int size)
Batch the elements of this
BiSequence into a sequence of BiSequences of distinct elements, each
with the given batch size. |
default Sequence<BiSequence<L,R>> |
batch(QuaternaryPredicate<? super L,? super R,? super L,? super R> predicate)
Batch the elements of this
EntrySequence into a sequence of EntrySequences of distinct elements,
where the given predicate determines where to split the lists of partitioned elements. |
default <S,C> S |
collect(java.util.stream.Collector<Pair<L,R>,C,S> collector)
Collect this
BiSequence into an arbitrary container using the given Collector. |
default <C> C |
collect(java.util.function.Supplier<? extends C> constructor,
java.util.function.BiConsumer<? super C,? super Pair<L,R>> adder)
Collect this
BiSequence into an arbitrary container using the given constructor and adder. |
default <C> C |
collectInto(C result,
java.util.function.BiConsumer<? super C,? super Pair<L,R>> adder)
Collect this
Sequence into the given container, using the given adder. |
default <U extends java.util.Collection<Pair<L,R>>> |
collectInto(U collection)
Collect this
BiSequence into the given Collection. |
default int |
count() |
default BiSequence<L,R> |
distinct() |
static <L,R> BiSequence<L,R> |
empty()
Create an empty
BiSequence with no items. |
default BiSequence<L,R> |
endingAt(java.util.function.BiPredicate<? super L,? super R> terminal)
Terminate this
BiSequence when the given predicate is satisfied, including the element that satisfies
the predicate as the last element in the BiSequence. |
default BiSequence<L,R> |
endingAt(L left,
R right)
Terminate this
BiSequence when the pair with the given left and right components is encountered,
including the element as the last element in the BiSequence. |
default BiSequence<L,R> |
endingAt(Pair<L,R> terminal)
Terminate this
BiSequence when the given element is encountered, including the element as the last
element in the BiSequence. |
default BiSequence<L,R> |
endingAt(java.util.function.Predicate<? super Pair<L,R>> terminal)
Terminate this
BiSequence when the given predicate is satisfied, including the element that satisfies
the predicate as the last element in the BiSequence. |
default BiSequence<L,R> |
filter(java.util.function.BiPredicate<? super L,? super R> predicate)
Filter the elements in this
BiSequence, keeping only the elements that match the given
BiPredicate. |
default BiSequence<L,R> |
filter(java.util.function.Predicate<? super Pair<L,R>> predicate)
Filter the elements in this
BiSequence, keeping only the pairs that match the given
Predicate. |
default java.util.Optional<Pair<L,R>> |
first() |
default <LL,RR> BiSequence<LL,RR> |
flatten(java.util.function.BiFunction<? super L,? super R,? extends java.lang.Iterable<Pair<LL,RR>>> mapper)
Flatten the elements in this
BiSequence according to the given mapper BiFunction. |
default <LL,RR> BiSequence<LL,RR> |
flatten(java.util.function.Function<? super Pair<L,R>,? extends java.lang.Iterable<Pair<LL,RR>>> function)
Flatten the elements in this
BiSequence according to the given mapper Function. |
default <LL> BiSequence<LL,R> |
flattenLeft(java.util.function.Function<? super Pair<L,R>,? extends java.lang.Iterable<LL>> mapper)
Flatten the left side of each pair in this sequence, applying multiples of left values returned by the given
mapper to the same right value of each pair.
|
default <RR> BiSequence<L,RR> |
flattenRight(java.util.function.Function<? super Pair<L,R>,? extends java.lang.Iterable<RR>> mapper)
Flatten the right side of each pair in this sequence, applying multiples of right values returned by the given
mapper to the same left value of each pair.
|
static <L,R> BiSequence<L,R> |
from(java.lang.Iterable<Pair<L,R>>... iterables)
Create a concatenated
BiSequence from several Iterables of pairs which are concatenated together
to form the stream of pairs in the BiSequence. |
static <L,R> BiSequence<L,R> |
from(java.lang.Iterable<Pair<L,R>> iterable)
Create a
BiSequence from an Iterable of pairs. |
static <L,R> BiSequence<L,R> |
from(java.util.Iterator<Pair<L,R>> iterator)
Create a
BiSequence from an Iterator of pairs. |
static <K,V> BiSequence<K,V> |
from(java.util.Map<K,V> map)
Create a
BiSequence of Map.Entry key/value items from a Map of items. |
static <L,R> BiSequence<L,R> |
from(java.util.stream.Stream<Pair<L,R>> stream)
Create a
BiSequence from a Stream of pairs. |
static <L,R> BiSequence<L,R> |
generate(java.util.function.Supplier<Pair<L,R>> supplier) |
default java.util.Optional<Pair<L,R>> |
get(long index) |
default java.lang.String |
join(java.lang.String delimiter)
Join this
BiSequence into a string separated by the given delimiter. |
default java.lang.String |
join(java.lang.String prefix,
java.lang.String delimiter,
java.lang.String suffix)
Join this
BiSequence into a string separated by the given delimiter, with the given prefix and suffix. |
default java.util.Optional<Pair<L,R>> |
last() |
default BiSequence<L,R> |
limit(int limit)
Limit the maximum number of results returned by this
BiSequence. |
default <LL,RR> BiSequence<LL,RR> |
map(java.util.function.BiFunction<? super L,? super R,? extends Pair<LL,RR>> mapper)
Map the pairs in this
BiSequence to another set of pairs specified by the given mapper
function. |
default <LL,RR> BiSequence<LL,RR> |
map(java.util.function.Function<? super L,? extends LL> leftMapper,
java.util.function.Function<? super R,? extends RR> rightMapper)
Map the pairs in this
BiSequence to another set of pairs specified by the given leftMapper
amd rightMapper functions. |
default <LL,RR> BiSequence<LL,RR> |
map(java.util.function.Function<? super Pair<L,R>,? extends Pair<LL,RR>> mapper)
Map the pairs in this
BiSequence to another set of pairs specified by the given mapper
function. |
default java.util.Optional<Pair<L,R>> |
max(java.util.Comparator<? super Pair<? extends L,? extends R>> comparator) |
default java.util.Optional<Pair<L,R>> |
min(java.util.Comparator<? super Pair<? extends L,? extends R>> comparator) |
default boolean |
none(java.util.function.BiPredicate<? super L,? super R> predicate) |
static <L,R> BiSequence<L,R> |
of(Pair<L,R>... items)
Create a
BiSequence with the given Pairs. |
static <L,R> BiSequence<L,R> |
of(Pair<L,R> item)
Create a
BiSequence with one Pair. |
static <L,R> BiSequence<L,R> |
ofPair(L left,
R right)
Create a
BiSequence with one Pair of the given left and right values. |
static <T,U> BiSequence<T,U> |
ofPairs(java.lang.Object... os)
Create a
BiSequence with Pairs of the given left and right values given in sequence in the input
array. |
default BiSequence<L,R> |
peek(java.util.function.BiConsumer<L,R> action)
Allow the given
Consumer to see each element in this BiSequence as it is traversed. |
static <L,R,LL,RR> |
recurse(L leftSeed,
R rightSeed,
java.util.function.BiFunction<? super L,? super R,? extends Pair<LL,RR>> f,
java.util.function.BiFunction<? super LL,? super RR,? extends Pair<L,R>> g)
Returns a
BiSequence produced by recursively applying the given mapper f and incrementer
g operations to the given seeds, the first element being f(leftSeed, rightSeed), the second
being f(g(f(leftSeed, rightSeed))), the third f(g(f(g(f(leftSeed, rightSeed))))) and so on. |
static <L,R> BiSequence<L,R> |
recurse(L leftSeed,
R rightSeed,
java.util.function.BiFunction<? super L,? super R,? extends Pair<L,R>> op)
Returns a
BiSequence produced by recursively applying the given operation to the given seeds, which
form the first element of the sequence, the second being f(leftSeed, rightSeed), the third
f(f(leftSeed, rightSeed)) and so on. |
static <L,R> BiSequence<L,R> |
recurse(Pair<L,R> seed,
java.util.function.UnaryOperator<Pair<L,R>> op)
Returns a
BiSequence produced by recursively applying the given operation to the given seed, which
form the first element of the sequence, the second being f(seed), the third f(f(seed)) and so
on. |
default java.util.Optional<Pair<L,R>> |
reduce(java.util.function.BinaryOperator<Pair<L,R>> operator)
Reduce this
BiSequence into a single element by iteratively applying the given binary operator to
the current result and each pair in this sequence. |
default Pair<L,R> |
reduce(L left,
R right,
QuaternaryFunction<L,R,L,R,Pair<L,R>> operator)
Reduce this
BiSequence into a single element by iteratively applying the given binary operator to
the current result and each entry in this sequence, starting with the given identity as the initial result. |
default Pair<L,R> |
reduce(Pair<L,R> identity,
java.util.function.BinaryOperator<Pair<L,R>> operator)
Reduce this
BiSequence into a single element by iteratively applying the given binary operator to
the current result and each pair in this sequence, starting with the given identity as the initial result. |
default java.util.Optional<Pair<L,R>> |
reduce(QuaternaryFunction<L,R,L,R,Pair<L,R>> operator)
Reduce this
BiSequence into a single element by iteratively applying the given function to
the current result and each element in this sequence. |
default void |
removeAll()
Remove all elements matched by this sequence using
Iterator.remove(). |
default BiSequence<L,R> |
repeat()
Repeat this
BiSequence forever, producing a sequence that never terminates unless the original sequence
is empty in which case the resulting sequence is also empty. |
default BiSequence<L,R> |
repeat(long times)
Repeat this
BiSequence the given number of times. |
default BiSequence<L,R> |
reverse() |
default java.util.Optional<Pair<L,R>> |
second() |
default BiSequence<L,R> |
shuffle() |
default BiSequence<L,R> |
shuffle(java.util.Random md) |
default BiSequence<L,R> |
skip(int skip)
Skip a set number of steps in this
BiSequence. |
default BiSequence<L,R> |
sorted() |
default BiSequence<L,R> |
sorted(java.util.Comparator<? super Pair<? extends L,? extends R>> comparator) |
default BiSequence<L,R> |
step(int step)
Skip x number of steps in between each invocation of the iterator of this
BiSequence. |
default java.util.stream.Stream<Pair<L,R>> |
stream() |
default java.util.Optional<Pair<L,R>> |
third() |
default Pair<L,R>[] |
toArray()
Collect the pairs in this
BiSequence into an array. |
default Pair<L,R>[] |
toArray(java.util.function.IntFunction<Pair<L,R>[]> constructor)
Collect the pairs in this
BiSequence into an array of the type determined by the given array
constructor. |
default <C extends java.util.Collection<Pair<L,R>>> |
toCollection(java.util.function.Supplier<? extends C> constructor)
Collect this
BiSequence into a Collection of the type determined by the given constructor. |
default java.util.List<Pair<L,R>> |
toList()
Collect the pairs in this
BiSequence into a List. |
default java.util.List<Pair<L,R>> |
toList(java.util.function.Supplier<java.util.List<Pair<L,R>>> constructor)
Collect the pairs in this
BiSequence into a List of the type determined by the given
constructor. |
default java.util.Map<L,R> |
toMap()
Collect the pairs in this
BiSequence into a Map. |
default <M extends java.util.Map<L,R>> |
toMap(java.util.function.Supplier<? extends M> constructor)
Collect the pairs in this
BiSequence into a Map of the type determined by the given
constructor. |
default Sequence<Pair<L,R>> |
toSequence()
|
default <T> Sequence<T> |
toSequence(java.util.function.BiFunction<? super L,? super R,? extends T> mapper)
Convert this
BiSequence to a Sequence where each item is generated by the given mapper. |
default <T> Sequence<T> |
toSequence(java.util.function.Function<? super Pair<L,R>,? extends T> mapper)
Convert this
BiSequence to a Sequence where each item is generated by the given mapper. |
default java.util.Set<Pair<L,R>> |
toSet()
Collect the pairs in this
BiSequence into a Set. |
default <S extends java.util.Set<Pair<L,R>>> |
toSet(java.util.function.Supplier<? extends S> constructor)
Collect the pairs in this
BiSequence into a Set of the type determined by the given
constructor. |
default java.util.SortedMap<L,R> |
toSortedMap()
Collect the pairs in this
BiSequence into a SortedMap. |
default java.util.SortedSet<Pair<L,R>> |
toSortedSet()
Collect the pairs in this
BiSequence into a SortedSet. |
default BiSequence<L,R> |
until(java.util.function.BiPredicate<? super L,? super R> terminal)
Terminate this
BiSequence just before the given predicate is satisfied, not including the element that
satisfies the predicate in the BiSequence. |
default BiSequence<L,R> |
until(L left,
R right)
Terminate this
BiSequence just before the pair with the given left and right components is encountered,
not including the pair in the BiSequence. |
default BiSequence<L,R> |
until(Pair<L,R> terminal)
Terminate this
BiSequence just before the given element is encountered, not including the element in the
BiSequence. |
default BiSequence<L,R> |
until(java.util.function.Predicate<? super Pair<L,R>> terminal)
Terminate this
BiSequence just before the given predicate is satisfied, not including the element that
satisfies the predicate in the BiSequence. |
default Sequence<BiSequence<L,R>> |
window(int window)
Window the elements of this
BiSequence into a Sequence of BiSequences of pairs, each
with the size of the given window. |
default Sequence<BiSequence<L,R>> |
window(int window,
int step)
Window the elements of this
BiSequence into a sequence of BiSequences of elements, each with the
size of the given window, stepping step elements between each window. |
static <L,R> BiSequence<L,R> empty()
BiSequence with no items.static <L,R> BiSequence<L,R> of(Pair<L,R> item)
BiSequence with one Pair.@SafeVarargs static <L,R> BiSequence<L,R> of(Pair<L,R>... items)
BiSequence with the given Pairs.of(Pair),
ofPair(Object, Object),
ofPairs(Object...),
from(Iterable)static <L,R> BiSequence<L,R> ofPair(L left, R right)
BiSequence with one Pair of the given left and right values.ofPairs(Object...),
of(Pair),
of(Pair...),
from(Iterable)static <T,U> BiSequence<T,U> ofPairs(java.lang.Object... os)
BiSequence with Pairs of the given left and right values given in sequence in the input
array.java.lang.IllegalArgumentException - if the array of left and right values is not of even length.ofPair(Object, Object),
of(Pair),
of(Pair...),
from(Iterable)static <L,R> BiSequence<L,R> from(java.lang.Iterable<Pair<L,R>> iterable)
BiSequence from an Iterable of pairs.of(Pair),
of(Pair...),
from(Iterable...)@SafeVarargs static <L,R> BiSequence<L,R> from(java.lang.Iterable<Pair<L,R>>... iterables)
BiSequence from several Iterables of pairs which are concatenated together
to form the stream of pairs in the BiSequence.of(Pair),
of(Pair...),
from(Iterable)static <L,R> BiSequence<L,R> from(java.util.Iterator<Pair<L,R>> iterator)
BiSequence from an Iterator of pairs. Note that BiSequences created from Iterators cannot be passed over more than once. Further attempts will register the BiSequence as empty.of(Pair),
of(Pair...),
from(Iterable)static <L,R> BiSequence<L,R> from(java.util.stream.Stream<Pair<L,R>> stream)
BiSequence from a Stream of pairs. Note that BiSequences created from
Streams cannot be passed over more than once. Further attempts will cause an
IllegalStateException when the Stream is requested again.of(Pair),
of(Pair...),
from(Iterable),
from(Iterator)static <K,V> BiSequence<K,V> from(java.util.Map<K,V> map)
BiSequence of Map.Entry key/value items from a Map of items. The resulting
BiSequence can be mapped using Pair items, which implement Map.Entry and can thus be
processed as part of the BiSequence's transformation steps.of(org.d2ab.util.Pair<L, R>),
from(Iterable)static <L,R> BiSequence<L,R> generate(java.util.function.Supplier<Pair<L,R>> supplier)
BiSequence generated by repeatedly calling the given supplier. The returned
BiSequence never terminates naturally.recurse(Pair, UnaryOperator),
endingAt(Pair),
until(Pair)static <L,R> BiSequence<L,R> recurse(L leftSeed, R rightSeed, java.util.function.BiFunction<? super L,? super R,? extends Pair<L,R>> op)
BiSequence produced by recursively applying the given operation to the given seeds, which
form the first element of the sequence, the second being f(leftSeed, rightSeed), the third
f(f(leftSeed, rightSeed)) and so on. The returned BiSequence never terminates naturally.BiSequence produced by recursively applying the given operation to the given seedrecurse(Pair, UnaryOperator),
generate(Supplier),
endingAt(Pair),
until(Pair)static <L,R> BiSequence<L,R> recurse(Pair<L,R> seed, java.util.function.UnaryOperator<Pair<L,R>> op)
BiSequence produced by recursively applying the given operation to the given seed, which
form the first element of the sequence, the second being f(seed), the third f(f(seed)) and so
on. The returned BiSequence never terminates naturally.BiSequence produced by recursively applying the given operation to the given seedrecurse(Pair, UnaryOperator),
generate(Supplier),
endingAt(Pair),
until(Pair)static <L,R,LL,RR> BiSequence<LL,RR> recurse(L leftSeed, R rightSeed, java.util.function.BiFunction<? super L,? super R,? extends Pair<LL,RR>> f, java.util.function.BiFunction<? super LL,? super RR,? extends Pair<L,R>> g)
BiSequence produced by recursively applying the given mapper f and incrementer
g operations to the given seeds, the first element being f(leftSeed, rightSeed), the second
being f(g(f(leftSeed, rightSeed))), the third f(g(f(g(f(leftSeed, rightSeed))))) and so on.
The returned BiSequence never terminates naturally.f - a mapper function for producing elements that are to be included in the sequence, the first being
f(leftSeed, rightSeed)g - an incrementer function for producing the next unmapped element to be included in the sequence,
applied to the first mapped element f(leftSeed, rightSeed) to produce the second unmapped valueBiSequence produced by recursively applying the given mapper and incrementer operations to the
given seedsrecurse(Pair, UnaryOperator),
endingAt(Pair),
until(Pair)default <LL,RR> BiSequence<LL,RR> map(java.util.function.BiFunction<? super L,? super R,? extends Pair<LL,RR>> mapper)
BiSequence to another set of pairs specified by the given mapper
function.map(Function),
map(Function, Function),
flatten(Function)default <LL,RR> BiSequence<LL,RR> map(java.util.function.Function<? super Pair<L,R>,? extends Pair<LL,RR>> mapper)
BiSequence to another set of pairs specified by the given mapper
function.map(BiFunction),
map(Function, Function),
flatten(Function)default <LL,RR> BiSequence<LL,RR> map(java.util.function.Function<? super L,? extends LL> leftMapper, java.util.function.Function<? super R,? extends RR> rightMapper)
BiSequence to another set of pairs specified by the given leftMapper
amd rightMapper functions.map(BiFunction),
map(Function),
flatten(Function)default BiSequence<L,R> skip(int skip)
BiSequence.default BiSequence<L,R> limit(int limit)
BiSequence.default BiSequence<L,R> filter(java.util.function.BiPredicate<? super L,? super R> predicate)
BiSequence, keeping only the elements that match the given
BiPredicate.default BiSequence<L,R> filter(java.util.function.Predicate<? super Pair<L,R>> predicate)
BiSequence, keeping only the pairs that match the given
Predicate.default <LL,RR> BiSequence<LL,RR> flatten(java.util.function.BiFunction<? super L,? super R,? extends java.lang.Iterable<Pair<LL,RR>>> mapper)
BiSequence according to the given mapper BiFunction. The resulting
BiSequence contains the elements that is the result of applying the mapper BiFunction to each
element, appended together inline as a single BiSequence.default <LL,RR> BiSequence<LL,RR> flatten(java.util.function.Function<? super Pair<L,R>,? extends java.lang.Iterable<Pair<LL,RR>>> function)
BiSequence according to the given mapper Function. The resulting
BiSequence contains the pairs that is the result of applying the mapper Function to each
pair, appended together inline as a single BiSequence.default <LL> BiSequence<LL,R> flattenLeft(java.util.function.Function<? super Pair<L,R>,? extends java.lang.Iterable<LL>> mapper)
default <RR> BiSequence<L,RR> flattenRight(java.util.function.Function<? super Pair<L,R>,? extends java.lang.Iterable<RR>> mapper)
default BiSequence<L,R> until(Pair<L,R> terminal)
BiSequence just before the given element is encountered, not including the element in the
BiSequence.default BiSequence<L,R> endingAt(Pair<L,R> terminal)
BiSequence when the given element is encountered, including the element as the last
element in the BiSequence.default BiSequence<L,R> until(L left, R right)
BiSequence just before the pair with the given left and right components is encountered,
not including the pair in the BiSequence.default BiSequence<L,R> endingAt(L left, R right)
BiSequence when the pair with the given left and right components is encountered,
including the element as the last element in the BiSequence.default BiSequence<L,R> until(java.util.function.BiPredicate<? super L,? super R> terminal)
BiSequence just before the given predicate is satisfied, not including the element that
satisfies the predicate in the BiSequence.default BiSequence<L,R> endingAt(java.util.function.BiPredicate<? super L,? super R> terminal)
BiSequence when the given predicate is satisfied, including the element that satisfies
the predicate as the last element in the BiSequence.default BiSequence<L,R> until(java.util.function.Predicate<? super Pair<L,R>> terminal)
BiSequence just before the given predicate is satisfied, not including the element that
satisfies the predicate in the BiSequence.default BiSequence<L,R> endingAt(java.util.function.Predicate<? super Pair<L,R>> terminal)
BiSequence when the given predicate is satisfied, including the element that satisfies
the predicate as the last element in the BiSequence.default Pair<L,R>[] toArray(java.util.function.IntFunction<Pair<L,R>[]> constructor)
BiSequence into an array of the type determined by the given array
constructor.default java.util.List<Pair<L,R>> toList(java.util.function.Supplier<java.util.List<Pair<L,R>>> constructor)
BiSequence into a List of the type determined by the given
constructor.default <S extends java.util.Set<Pair<L,R>>> S toSet(java.util.function.Supplier<? extends S> constructor)
BiSequence into a Set of the type determined by the given
constructor.default java.util.SortedSet<Pair<L,R>> toSortedSet()
BiSequence into a SortedSet.default <M extends java.util.Map<L,R>> M toMap(java.util.function.Supplier<? extends M> constructor)
BiSequence into a Map of the type determined by the given
constructor.default java.util.SortedMap<L,R> toSortedMap()
BiSequence into a SortedMap.default <C extends java.util.Collection<Pair<L,R>>> C toCollection(java.util.function.Supplier<? extends C> constructor)
BiSequence into a Collection of the type determined by the given constructor.default <C> C collect(java.util.function.Supplier<? extends C> constructor,
java.util.function.BiConsumer<? super C,? super Pair<L,R>> adder)
BiSequence into an arbitrary container using the given constructor and adder.default <S,C> S collect(java.util.stream.Collector<Pair<L,R>,C,S> collector)
BiSequence into an arbitrary container using the given Collector.default <U extends java.util.Collection<Pair<L,R>>> U collectInto(U collection)
BiSequence into the given Collection.default <C> C collectInto(C result,
java.util.function.BiConsumer<? super C,? super Pair<L,R>> adder)
Sequence into the given container, using the given adder.default java.lang.String join(java.lang.String delimiter)
BiSequence into a string separated by the given delimiter.default java.lang.String join(java.lang.String prefix,
java.lang.String delimiter,
java.lang.String suffix)
BiSequence into a string separated by the given delimiter, with the given prefix and suffix.default java.util.Optional<Pair<L,R>> reduce(java.util.function.BinaryOperator<Pair<L,R>> operator)
BiSequence into a single element by iteratively applying the given binary operator to
the current result and each pair in this sequence.default java.util.Optional<Pair<L,R>> reduce(QuaternaryFunction<L,R,L,R,Pair<L,R>> operator)
BiSequence into a single element by iteratively applying the given function to
the current result and each element in this sequence. The function is passed the left and right components of
the result pair, followed by the left and right components of the current pair, respectively.default Pair<L,R> reduce(Pair<L,R> identity, java.util.function.BinaryOperator<Pair<L,R>> operator)
BiSequence into a single element by iteratively applying the given binary operator to
the current result and each pair in this sequence, starting with the given identity as the initial result.default Pair<L,R> reduce(L left, R right, QuaternaryFunction<L,R,L,R,Pair<L,R>> operator)
BiSequence into a single element by iteratively applying the given binary operator to
the current result and each entry in this sequence, starting with the given identity as the initial result.
The function is passed the left and right components of the result, followed by the left and right components of
the current entry, respectively.default java.util.Optional<Pair<L,R>> first()
BiSequence or an empty Optional if there are no pairs in the
BiSequence.default java.util.Optional<Pair<L,R>> second()
BiSequence or an empty Optional if there are one or less pairs
in the BiSequence.default java.util.Optional<Pair<L,R>> third()
BiSequence or an empty Optional if there are two or less pairs
in the BiSequence.default java.util.Optional<Pair<L,R>> get(long index)
Optional if the EntrySequence is smaller
than the index.default java.util.Optional<Pair<L,R>> last()
BiSequence or an empty Optional if there are no pairs in the
BiSequence.default Sequence<BiSequence<L,R>> window(int window)
BiSequence into a Sequence of BiSequences of pairs, each
with the size of the given window. The first item in each sequence is the second item in the previous sequence.
The final sequence may be shorter than the window. This method is equivalent to window(window, 1).default Sequence<BiSequence<L,R>> window(int window, int step)
BiSequence into a sequence of BiSequences of elements, each with the
size of the given window, stepping step elements between each window. If the given step is less than the
window size, the windows will overlap each other. If the step is larger than the window size, elements will be
skipped in between windows.default Sequence<BiSequence<L,R>> batch(int size)
BiSequence into a sequence of BiSequences of distinct elements, each
with the given batch size. This method is equivalent to window(size, size).default Sequence<BiSequence<L,R>> batch(java.util.function.BiPredicate<? super Pair<L,R>,? super Pair<L,R>> predicate)
BiSequence into a sequence of BiSequences of distinct elements, where
the given predicate determines where to split the lists of partitioned elements. The predicate is given the
current and next item in the iteration, and if it returns true a partition is created between the elements.default Sequence<BiSequence<L,R>> batch(QuaternaryPredicate<? super L,? super R,? super L,? super R> predicate)
EntrySequence into a sequence of EntrySequences of distinct elements,
where the given predicate determines where to split the lists of partitioned elements. The predicate is given
the left and right values of the current and next items in the iteration, and if it returns true a partition is
created between the elements.default BiSequence<L,R> step(int step)
BiSequence.default BiSequence<L,R> distinct()
BiSequence where each item in this BiSequence occurs only once, the first time it is
encountered.default BiSequence<L,R> sorted()
BiSequence sorted according to the natural order.default BiSequence<L,R> sorted(java.util.Comparator<? super Pair<? extends L,? extends R>> comparator)
BiSequence sorted according to the given Comparator.default java.util.Optional<Pair<L,R>> min(java.util.Comparator<? super Pair<? extends L,? extends R>> comparator)
BiSequence according to the given Comparator.default java.util.Optional<Pair<L,R>> max(java.util.Comparator<? super Pair<? extends L,? extends R>> comparator)
BiSequence according to the given Comparator.default int count()
BiSequence.default java.util.stream.Stream<Pair<L,R>> stream()
BiSequence as a Stream of pairs.default boolean all(java.util.function.BiPredicate<? super L,? super R> biPredicate)
BiSequence satisfy the given predicate, false otherwise.default boolean none(java.util.function.BiPredicate<? super L,? super R> predicate)
BiSequence satisfy the given predicate, false otherwise.default boolean any(java.util.function.BiPredicate<? super L,? super R> biPredicate)
BiSequence satisfies the given predicate, false otherwise.default BiSequence<L,R> peek(java.util.function.BiConsumer<L,R> action)
Consumer to see each element in this BiSequence as it is traversed.default BiSequence<L,R> append(java.util.Iterator<? extends Pair<L,R>> iterator)
Iterator to the end of this BiSequence.
The appended elements will only be available on the first traversal of the resulting Sequence.
default BiSequence<L,R> append(java.lang.Iterable<? extends Pair<L,R>> that)
Iterable to the end of this BiSequence.default BiSequence<L,R> append(Pair<L,R>... entries)
BiSequence.default BiSequence<L,R> appendPair(L left, R right)
BiSequence.default BiSequence<L,R> append(java.util.stream.Stream<Pair<L,R>> stream)
Stream to the end of this BiSequence.
The resulting BiSequence can only be traversed once, further attempts to traverse will results in a
IllegalStateException.
default <T> Sequence<T> toSequence(java.util.function.BiFunction<? super L,? super R,? extends T> mapper)
BiSequence to a Sequence where each item is generated by the given mapper.default <T> Sequence<T> toSequence(java.util.function.Function<? super Pair<L,R>,? extends T> mapper)
BiSequence to a Sequence where each item is generated by the given mapper.default BiSequence<L,R> repeat()
BiSequence forever, producing a sequence that never terminates unless the original sequence
is empty in which case the resulting sequence is also empty.default BiSequence<L,R> repeat(long times)
BiSequence the given number of times.default BiSequence<L,R> reverse()
BiSequence which iterates over this BiSequence in reverse order.default BiSequence<L,R> shuffle()
BiSequence which iterates over this BiSequence in random order.default BiSequence<L,R> shuffle(java.util.Random md)
BiSequence which iterates over this BiSequence in random order as determined by the
given random generator.default void removeAll()
Iterator.remove().