Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.pairs
Class DoubleIntPair

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.pairs.DoubleIntPair
All Implemented Interfaces:
Comparable<DoubleIntPair>

public class DoubleIntPair
extends Object
implements Comparable<DoubleIntPair>

Pair storing an integer and a double. Since double and int are native types, this can't be done via the CPair generic.

Author:
Erich Schubert

Field Summary
 double first
          first value
 int second
          second value
 
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()
          Get first value
 int getSecond()
          Get second value
 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

first

public double first
first value


second

public int second
second value

Constructor Detail

DoubleIntPair

public DoubleIntPair(double first,
                     int second)
Constructor

Parameters:
first -
second -
Method Detail

equals

public boolean equals(Object obj)
Trivial equals implementation

Overrides:
equals in class Object
Parameters:
obj - Object to compare to

hashCode

public final int hashCode()
Trivial hashCode implementation mixing the two integers.

Overrides:
hashCode in class Object

compareTo

public int compareTo(DoubleIntPair other)
Implementation of comparable interface, sorting by first then second.

Specified by:
compareTo in interface Comparable<DoubleIntPair>
Parameters:
other - Object to compare to
Returns:
comparison result

compareSwappedTo

public int compareSwappedTo(DoubleIntPair other)
Implementation of comparableSwapped interface, sorting by second then first.

Parameters:
other - Object to compare to
Returns:
comparison result

getFirst

public final double getFirst()
Get first value

Returns:
first value

setFirst

public final void setFirst(double first)
Set first value

Parameters:
first - new value

getSecond

public final int getSecond()
Get second value

Returns:
second value

setSecond

public final void setSecond(int second)
Set second value

Parameters:
second - new value

Release 0.2.1 (2009-07-13_1605)