public class IntDoublePair extends java.lang.Object implements java.lang.Comparable<IntDoublePair>
| Modifier and Type | Field and Description |
|---|---|
static java.util.Comparator<IntDoublePair> |
BYFIRST_COMPARATOR
Comparator to compare by second component only
|
static java.util.Comparator<IntDoublePair> |
BYSECOND_COMPARATOR
Comparator to compare by second component only
|
int |
first
first value
|
double |
second
second value
|
static java.util.Comparator<IntDoublePair> |
SWAPPED_COMPARATOR
Comparator to compare by swapped components
|
| Constructor and Description |
|---|
IntDoublePair(int first,
double second)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareSwappedTo(IntDoublePair other)
Implementation of comparableSwapped interface, sorting by second then
first.
|
int |
compareTo(IntDoublePair other)
Implementation of comparable interface, sorting by first then second.
|
boolean |
equals(java.lang.Object obj)
Trivial equals implementation
|
int |
hashCode()
Trivial hashCode implementation mixing the two integers.
|
void |
setFirst(int first)
Set first value
|
void |
setSecond(double second)
Set second value
|
java.lang.String |
toString()
Returns first and second value.
|
public int first
public double second
public static final java.util.Comparator<IntDoublePair> BYFIRST_COMPARATOR
public static final java.util.Comparator<IntDoublePair> BYSECOND_COMPARATOR
public static final java.util.Comparator<IntDoublePair> SWAPPED_COMPARATOR
public IntDoublePair(int first,
double second)
first - First valuesecond - Second valuepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Object to compare topublic final int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(IntDoublePair other)
compareTo in interface java.lang.Comparable<IntDoublePair>other - Object to compare topublic int compareSwappedTo(IntDoublePair other)
other - Object to compare topublic final void setFirst(int first)
first - new valuepublic final void setSecond(double second)
second - new valuepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2019 ELKI Development Team. License information.