Package org.apache.calcite.util.mapping
Class IntPair
java.lang.Object
org.apache.calcite.util.mapping.IntPair
An immutable pair of integers.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionDeprecated.static final com.google.common.collect.Ordering<IntPair>
Ordering that compares pairs lexicographically: first by their source, then by their target.Deprecated.final int
Deprecated.final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
Returns the left side of a list of pairs.static IntPair
of
(int left, int right) Returns the right side of a list of pairs.toString()
Converts two lists into a list ofIntPair
s, whose length is the lesser of the lengths of the source lists.Converts two lists into a list ofIntPair
s.
-
Field Details
-
SWAP
Deprecated.Function that swaps source and target fields of anIntPair
. -
ORDERING
Ordering that compares pairs lexicographically: first by their source, then by their target. -
LEFT
Deprecated.Function that returns the left (source) side of a pair. -
RIGHT
Deprecated.Function that returns the right (target) side of a pair. -
source
public final int source -
target
public final int target
-
-
Constructor Details
-
IntPair
public IntPair(int source, int target)
-
-
Method Details
-
of
-
toString
-
equals
-
hashCode
public int hashCode() -
zip
Converts two lists into a list ofIntPair
s, whose length is the lesser of the lengths of the source lists.- Parameters:
lefts
- Left listrights
- Right list- Returns:
- List of pairs
-
zip
public static List<IntPair> zip(List<? extends Number> lefts, List<? extends Number> rights, boolean strict) Converts two lists into a list ofIntPair
s.The length of the combined list is the lesser of the lengths of the source lists. But typically the source lists will be the same length.
- Parameters:
lefts
- Left listrights
- Right liststrict
- Whether to fail if lists have different size- Returns:
- List of pairs
-
left
Returns the left side of a list of pairs. -
right
Returns the right side of a list of pairs.
-