public class DoubleIntPair extends java.lang.Object implements java.lang.Comparable<DoubleIntPair>
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<DoubleIntPair> |
BYFIRST_COMPARATOR
Comparator to compare by first component only
|
static java.util.Comparator<DoubleIntPair> |
BYSECOND_COMPARATOR
Comparator to compare by second component only
|
double |
first
first value
|
int |
second
second value
|
static java.util.Comparator<DoubleIntPair> |
SWAPPED_COMPARATOR
Comparator to compare by swapped components
|
Constructor and Description |
---|
DoubleIntPair(double first,
int second)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareSwappedTo(DoubleIntPair other)
Implementation of comparableSwapped interface, sorting by second then
first.
|
int |
compareTo(DoubleIntPair 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(double first)
Set first value
|
void |
setSecond(int second)
Set second value
|
public double first
public int second
public static final java.util.Comparator<DoubleIntPair> BYFIRST_COMPARATOR
public static final java.util.Comparator<DoubleIntPair> BYSECOND_COMPARATOR
public static final java.util.Comparator<DoubleIntPair> SWAPPED_COMPARATOR
public DoubleIntPair(double first, int second)
first
- First valuesecond
- Second valuepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to compare topublic final int hashCode()
hashCode
in class java.lang.Object
public int compareTo(DoubleIntPair other)
compareTo
in interface java.lang.Comparable<DoubleIntPair>
other
- Object to compare topublic int compareSwappedTo(DoubleIntPair other)
other
- Object to compare topublic final void setFirst(double first)
first
- new valuepublic final void setSecond(int second)
second
- new valueCopyright © 2019 ELKI Development Team. License information.