Index
All Classes|All Packages
A
- accept(BiConsumer<? super T1, ? super T2>) - Method in class ch.rfin.util.Pair
-
Use the binary consumer to consume this pair.
- apply(BiFunction<? super T1, ? super T2, ? extends R>) - Method in class ch.rfin.util.Pair
-
Apply the binary function to this pair.
B
- biConsumer(Consumer<Pair<T1, T2>>) - Static method in class ch.rfin.util.Pairs
-
(f: (x,y) → _) → (g: x,y → _)- Converts a unary consumer of pairs to a binary consumer. - biFunction(Function<Pair<T1, T2>, ? extends R>) - Static method in class ch.rfin.util.Pairs
-
(f: (x,y) → z) → (g: x,y → z)- Converts a unary function from pairs to a binary function. - biPredicate(Predicate<Pair<T1, T2>>) - Static method in class ch.rfin.util.Pairs
-
(f: (x,y) → T/F) → (g: x,y → T/F)- Converts a unary predicate from pairs to a binary predicate.
C
- ch.rfin.util - package ch.rfin.util
- comparator() - Static method in class ch.rfin.util.Pairs
-
Returns a Comparator that compares pairs lexicographically.
- compare(Pair<T1, T2>, Pair<T1, T2>) - Static method in class ch.rfin.util.Pairs
-
Compare two pairs lexicographically.
- consumer(BiConsumer<? super T1, ? super T2>) - Static method in class ch.rfin.util.Pairs
-
(f: x,y → _) → (g: (x,y) → _)- Converts a binary consumer to a consumer that is unary for pairs.
E
- enumerate(Iterable<T>) - Static method in class ch.rfin.util.Pairs
-
[x₀, x₁, x₂, …] → [(0,x₀), (1,x₁), (2,x₂), …]- Converts an iterable to a stream of pairs where the first value is the index of the value. - equals(Object) - Method in class ch.rfin.util.Pair
F
- function(BiFunction<? super T1, ? super T2, ? extends R>) - Static method in class ch.rfin.util.Pairs
-
(f: x,y → z) → (g: (x,y) → z)- Converts a binary function to a function that is unary for pairs.
G
- get_1() - Method in class ch.rfin.util.Pair
-
(a,b).get_1() = a. - get_2() - Method in class ch.rfin.util.Pair
-
(a,b).get_2() = b.
H
- hashCode() - Method in class ch.rfin.util.Pair
M
- map(Function<? super T1, ? extends R>, Function<? super T2, ? extends U>) - Static method in class ch.rfin.util.Pairs
-
(f: x → y), (g: u → v) → (h: (x,u) → (f(x),g(u)))- Returns a function for mapping both elements in a pair. - map(Function<? super T1, ? extends U>, Function<? super T2, ? extends R>) - Method in class ch.rfin.util.Pair
-
Allows
q = p.map(f, g);instead ofq = Pair.of(f.apply(p._1), g.apply(p._2)). - map_1(Function<? super T1, ? extends R>) - Static method in class ch.rfin.util.Pairs
-
(f: x → y) → (g: (x,y) → (f(x),y))- Returns a function for mapping the first element in a pair. - map_1(Function<? super T1, ? extends U>) - Method in class ch.rfin.util.Pair
-
Allows
q = p.map_1(f);instead ofq = Pair.of(f.apply(p._1), p._2). - map_2(Function<? super T2, ? extends R>) - Static method in class ch.rfin.util.Pairs
-
(f: x → y) → (g: (x,y) → (x,f(y)))- Returns a function for mapping the second element in a pair. - map_2(Function<? super T2, ? extends U>) - Method in class ch.rfin.util.Pair
-
Allows
q = p.map_2(f);instead ofq = Pair.of(p._1, f.apply(p._2)).
O
- of(T) - Static method in class ch.rfin.util.Pair
-
Special case factory method for making a duplicate pair (
x -> (x,x)). - of(T1, T2) - Static method in class ch.rfin.util.Pair
-
Factory method.
P
- pair(T) - Static method in class ch.rfin.util.Pair
-
More descriptive alias for
Pair.of(Object); useful for static imports. - pair(T1, T2) - Static method in class ch.rfin.util.Pair
-
More descriptive alias for
Pair.of(Object, Object); useful for static imports. - Pair<T1,T2> - Class in ch.rfin.util
-
A Pair of values.
- pairFrom(List<T>) - Static method in class ch.rfin.util.Pairs
-
[x₁, x₂, …] → (x₁, x₂)- converts a list to a pair. - pairFrom(Map.Entry<K, V>) - Static method in class ch.rfin.util.Pairs
-
(k:v) → (k,v)- converts a Map.Entry to a key-value pair. - pairs(List<T>) - Static method in class ch.rfin.util.Pairs
-
Deprecated, for removal: This API element is subject to removal in a future version.
- pairs(Map<K, V>) - Static method in class ch.rfin.util.Pairs
-
Deprecated, for removal: This API element is subject to removal in a future version.Since 1.1.0.
- Pairs - Class in ch.rfin.util
-
Utilities for working with pairs.
- pairsFrom(Iterable<T>) - Static method in class ch.rfin.util.Pairs
-
Converts an iterable to a list of pairs.
- pairsFrom(Map<K, V>) - Static method in class ch.rfin.util.Pairs
-
Converts a Map to a list of pairs.
- pairsToMap() - Static method in class ch.rfin.util.Pairs
-
Returns a Collector that can collect a stream of pairs into a Map.
- pairWithFirst(T1) - Static method in class ch.rfin.util.Pairs
-
a → (b → (a,b)) - Takes an item and returns a function that will take a second item and return a pair with the parameter to this function first and the parameter to the returned function second.
- pairWithSecond(T2) - Static method in class ch.rfin.util.Pairs
-
b → (a → (a,b)) - Takes an item and returns a function that will take a second item and return a pair with the parameter to this function second and the parameter to the returned function first.
- predicate(BiPredicate<? super T1, ? super T2>) - Static method in class ch.rfin.util.Pairs
-
(f: x,y → T/F) → (g: (x,y) → T/F)- Converts a binary predicate to a predicate that is unary for pairs.
S
- stream(Iterable<T>) - Static method in class ch.rfin.util.Pairs
-
[x₀, x₁, x₂, …] → [(x₀,x₁), (x₂,x₃), (x₄,x₅), …]- Converts an iterable of values to a stream of pairs, consuming two at a time. - stream(Map<K, V>) - Static method in class ch.rfin.util.Pairs
-
[(k₀:v₀), (k₁:v₁), (k₂:v₂), …] → [(k₀,v₀), (k₁,v₁), (k₂,v₂), …]- Converts a Map to a stream of key-value pairs. - streamAdjacent(Iterable<T>) - Static method in class ch.rfin.util.Pairs
-
[x₀, x₁, x₂, …] → [(x₀,x₁), (x₁,x₂), (x₂,x₃), …]- Converts an iterable to a stream of pairs of adjacent values. - swap() - Method in class ch.rfin.util.Pair
-
(a,b).swap() = (b,a)
T
- test(BiPredicate<? super T1, ? super T2>) - Method in class ch.rfin.util.Pair
-
Use the binary predicate to test this pair.
- test_1(Predicate<? super T1>) - Static method in class ch.rfin.util.Pairs
-
(f: x → T/F) → (g: (x,y) → (f(x),y))- Returns a predicate for testing the first element in a pair. - test_2(Predicate<? super T2>) - Static method in class ch.rfin.util.Pairs
-
(f: x → T/F) → (g: (x,y) → (x,f(y)))- Returns a predicate for testing the second element in a pair. - toMap(Iterable<Pair<K, V>>) - Static method in class ch.rfin.util.Pairs
-
[(k₀,v₀), (k₁,v₁), (k₂,v₂), …] → [(k₀:v₀), (k₁:v₁), (k₂:v₂), …]- Converts pairs to a Map. - toString() - Method in class ch.rfin.util.Pair
W
- with_1(U) - Method in class ch.rfin.util.Pair
-
(a,b).with_1(c) = (c,b) - with_2(U) - Method in class ch.rfin.util.Pair
-
(a,b).with_2(c) = (a,c) - withId(Function<? super T, ? extends R>) - Static method in class ch.rfin.util.Pairs
-
(f: x → y) → (g: x → (x,y))- Takes a function and returns a function to pairs, where the first element is the original input and the second element is the output.
Z
- zip(Iterable<T1>, Iterable<T2>) - Static method in class ch.rfin.util.Pairs
-
([x₀, x₁, x₂, …], [y₀, y₁, y₂, …]) → [(x₀,y₀), (x₁,y₁), (x₂,y₂), …]- likezip(xs, ys)in Python.
_
A B C E F G H M O P S T W Z _All Classes|All Packages
pairsFrom(Iterable)instead.