Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities
Class IDDoublePair

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

public class IDDoublePair
extends Object
implements Comparable<IDDoublePair>

Encapsulates the attributes of a pair containing an integer id and a double value.

Author:
Peer Kro¨ger

Field Summary
private  int id
          The id.
private  double value
          The value.
 
Constructor Summary
IDDoublePair(int id, double value)
          Constructs a pair of a given id and a given value.
 
Method Summary
 int compareTo(IDDoublePair o)
          Compares this object with the specified object for order.
 int getID()
          Returns the id of this pair.
 double getValue()
          Returns the value of this pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private final int id
The id.


value

private final double value
The value.

Constructor Detail

IDDoublePair

public IDDoublePair(int id,
                    double value)
Constructs a pair of a given id and a given value.

Parameters:
id - the id
value - the value
Method Detail

getID

public int getID()
Returns the id of this pair.

Returns:
the id of this pair

getValue

public double getValue()
Returns the value of this pair.

Returns:
the value of this pair

compareTo

public int compareTo(IDDoublePair o)
Compares this object with the specified object for order. Returns a negative integer or a positive integer as the value of this object is less than or greater than the the value of the specified object. If both values are equal the ids of both objects are compared.

Specified by:
compareTo in interface Comparable<IDDoublePair>
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.

Release 0.1 (2008-07-10_1838)