|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.pairs.DoubleIntPair
public class DoubleIntPair

Pair storing an integer and a double.
Since double and int are native types, this can't be done via the
CPair generic.
| Field Summary | |
|---|---|
static Comparator<DoubleIntPair> |
BYFIRST_COMPARATOR
Comparator to compare by second component only |
static Comparator<DoubleIntPair> |
BYSECOND_COMPARATOR
Comparator to compare by second component only |
double |
first
first value |
int |
second
second value |
static Comparator<DoubleIntPair> |
SWAPPED_COMPARATOR
Comparator to compare by swapped components |
| Constructor Summary | |
|---|---|
DoubleIntPair(double first,
int second)
Constructor |
|
| Method Summary | |
|---|---|
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(Object obj)
Trivial equals implementation |
Double |
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(double 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 double first
public int second
public static final Comparator<DoubleIntPair> BYFIRST_COMPARATOR
public static final Comparator<DoubleIntPair> BYSECOND_COMPARATOR
public static final Comparator<DoubleIntPair> SWAPPED_COMPARATOR
| Constructor Detail |
|---|
public DoubleIntPair(double first,
int second)
first - First valuesecond - Second value| Method Detail |
|---|
public boolean equals(Object obj)
equals in class Objectobj - Object to compare topublic final int hashCode()
hashCode in class Objectpublic int compareTo(DoubleIntPair other)
compareTo in interface Comparable<DoubleIntPair>other - Object to compare to
public int compareSwappedTo(DoubleIntPair other)
other - Object to compare to
@Deprecated public final Double getFirst()
PairInterface
getFirst in interface PairInterface<Double,Integer>public final void setFirst(double first)
first - new value@Deprecated public final Integer getSecond()
PairInterface
getSecond in interface PairInterface<Double,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 | |||||||||||