public class IntPair
extends java.lang.Object
Mapping.iterator()
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Function<IntPair,java.lang.Integer> |
LEFT
Function that returns the left (source) side of a pair.
|
static com.google.common.collect.Ordering<IntPair> |
ORDERING
Ordering that compares pairs lexicographically: first by their source,
then by their target.
|
static com.google.common.base.Function<IntPair,java.lang.Integer> |
RIGHT
Function that returns the right (target) side of a pair.
|
int |
source |
static com.google.common.base.Function<IntPair,IntPair> |
SWAP
Function that swaps source and target fields of an
IntPair . |
int |
target |
Constructor and Description |
---|
IntPair(int source,
int target) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
static java.util.List<java.lang.Integer> |
left(java.util.List<IntPair> pairs)
Returns the left side of a list of pairs.
|
static IntPair |
of(int left,
int right) |
static java.util.List<java.lang.Integer> |
right(java.util.List<IntPair> pairs)
Returns the right side of a list of pairs.
|
java.lang.String |
toString() |
static java.util.List<IntPair> |
zip(java.util.List<? extends java.lang.Number> lefts,
java.util.List<? extends java.lang.Number> rights)
Converts two lists into a list of
IntPair s,
whose length is the lesser of the lengths of the
source lists. |
static java.util.List<IntPair> |
zip(java.util.List<? extends java.lang.Number> lefts,
java.util.List<? extends java.lang.Number> rights,
boolean strict)
Converts two lists into a list of
IntPair s. |
public static final com.google.common.base.Function<IntPair,IntPair> SWAP
IntPair
.public static final com.google.common.collect.Ordering<IntPair> ORDERING
public static final com.google.common.base.Function<IntPair,java.lang.Integer> LEFT
public static final com.google.common.base.Function<IntPair,java.lang.Integer> RIGHT
public final int source
public final int target
public static IntPair of(int left, int right)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static java.util.List<IntPair> zip(java.util.List<? extends java.lang.Number> lefts, java.util.List<? extends java.lang.Number> rights)
IntPair
s,
whose length is the lesser of the lengths of the
source lists.lefts
- Left listrights
- Right listpublic static java.util.List<IntPair> zip(java.util.List<? extends java.lang.Number> lefts, java.util.List<? extends java.lang.Number> rights, boolean strict)
IntPair
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.
lefts
- Left listrights
- Right liststrict
- Whether to fail if lists have different sizepublic static java.util.List<java.lang.Integer> left(java.util.List<IntPair> pairs)
public static java.util.List<java.lang.Integer> right(java.util.List<IntPair> pairs)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.