|
||||||||||
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.DoubleDoublePair
public class DoubleDoublePair
Pair storing two doubles.
Since double is a native type, this can't be done via the CPair
generic.
Field Summary | |
---|---|
static Comparator<DoubleDoublePair> |
BYFIRST_COMPARATOR
Comparator to compare by second component only |
static Comparator<DoubleDoublePair> |
BYSECOND_COMPARATOR
Comparator to compare by second component only |
double |
first
first value |
double |
second
second value |
static Comparator<DoubleDoublePair> |
SWAPPED_COMPARATOR
Comparator to compare by swapped components |
Constructor Summary | |
---|---|
DoubleDoublePair(double first,
double second)
Constructor |
Method Summary | |
---|---|
int |
compareSwappedTo(DoubleDoublePair other)
Implementation of comparableSwapped interface, sorting by second then first. |
int |
compareTo(DoubleDoublePair 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! |
Double |
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(double second)
Set second value |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double first
public double second
public static final Comparator<DoubleDoublePair> BYFIRST_COMPARATOR
public static final Comparator<DoubleDoublePair> BYSECOND_COMPARATOR
public static final Comparator<DoubleDoublePair> SWAPPED_COMPARATOR
Constructor Detail |
---|
public DoubleDoublePair(double first, double 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(DoubleDoublePair other)
compareTo
in interface Comparable<DoubleDoublePair>
other
- Object to compare to
public int compareSwappedTo(DoubleDoublePair other)
other
- Object to compare to
@Deprecated public final Double getFirst()
PairInterface
getFirst
in interface PairInterface<Double,Double>
public final void setFirst(double first)
first
- new value@Deprecated public final Double getSecond()
PairInterface
getSecond
in interface PairInterface<Double,Double>
public final void setSecond(double second)
second
- new valuepublic String toString()
toString
in class Object
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |