|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.utilities.pairs.IntIntPair
public class IntIntPair
Pair storing two integers.
Since int is a native type, this can't be done via the CPair
generic.
Field Summary | |
---|---|
static Comparator<IntIntPair> |
BYFIRST_COMPARATOR
Comparator to compare by second component only |
static Comparator<IntIntPair> |
BYSECOND_COMPARATOR
Comparator to compare by second component only |
int |
first
first value |
int |
second
second value |
static Comparator<IntIntPair> |
SWAPPED_COMPARATOR
Comparator to compare by swapped components |
Constructor Summary | |
---|---|
IntIntPair(int first,
int second)
Constructor |
Method Summary | |
---|---|
int |
compareSwappedTo(IntIntPair other)
Implementation of comparableSwapped interface, sorting by second then first. |
int |
compareTo(IntIntPair other)
Implementation of comparable interface, sorting by first then second. |
boolean |
equals(Object obj)
Trivial equals implementation |
Integer |
getFirst()
Deprecated. use pair.first to avoid boxing! |
Integer |
getSecond()
Deprecated. use pair.first to avoid boxing! |
int |
hashCode()
Trivial hashCode implementation mixing the two integers. |
void |
setFirst(int first)
Set first value |
void |
setSecond(int second)
Set second value |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int first
public int second
public static final Comparator<IntIntPair> BYFIRST_COMPARATOR
public static final Comparator<IntIntPair> BYSECOND_COMPARATOR
public static final Comparator<IntIntPair> SWAPPED_COMPARATOR
Constructor Detail |
---|
public IntIntPair(int first, int second)
first
- First valuesecond
- Second valueMethod Detail |
---|
public boolean equals(Object obj)
equals
in class Object
obj
- Object to compare topublic final int hashCode()
hashCode
in class Object
public int compareTo(IntIntPair other)
compareTo
in interface Comparable<IntIntPair>
other
- Object to compare to
public int compareSwappedTo(IntIntPair other)
other
- Object to compare to
@Deprecated public final Integer getFirst()
PairInterface
getFirst
in interface PairInterface<Integer,Integer>
public final void setFirst(int first)
first
- new value@Deprecated public final Integer getSecond()
PairInterface
getSecond
in interface PairInterface<Integer,Integer>
public final void setSecond(int second)
second
- new value
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |