public interface Pair<T,U>
| Modifier and Type | Method and Description |
|---|---|
default void |
accept(BiConsumer<? super T,? super U> consumer)
Accept pair items using consumer.
|
<R> R |
apply(BiFunction<? super T,? super U,? extends R> func)
Apply pair using function.
|
static <T,U> Pair<T,U> |
of(T first,
U second)
New pair.
|
default Unit<T> |
pop()
Skip second value to make a unit.
|
default <V> Triplet<T,U,V> |
push(V val)
Push third item to make a triplet.
|
static <T,U> Iterable<Pair<T,U>> |
zip(Iterable<? extends T> first,
Iterable<? extends U> second)
Zip two iterables into single iterable of pairs.
|
<R> R apply(BiFunction<? super T,? super U,? extends R> func)
R - Result typefunc - Function to applydefault void accept(BiConsumer<? super T,? super U> consumer)
consumer - Acceptor.default <V> Triplet<T,U,V> push(V val)
V - Third item typeval - Third item valuestatic <T,U> Pair<T,U> of(T first, U second)
T - First item typeU - Second item typefirst - First item valuesecond - Second item valueCopyright © 2021. All rights reserved.