Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance
Class IntegerDistance

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.distance.AbstractDistance<D>
          extended by de.lmu.ifi.dbs.elki.distance.NumberDistance<IntegerDistance>
              extended by de.lmu.ifi.dbs.elki.distance.IntegerDistance
All Implemented Interfaces:
Distance<IntegerDistance>, Loggable, Externalizable, Serializable, Comparable<IntegerDistance>

public class IntegerDistance
extends NumberDistance<IntegerDistance>

Author:
Arthur Zimek
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Created serial version UID.
private  int value
           
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
IntegerDistance()
           
IntegerDistance(int value)
           
 
Method Summary
 int compareTo(IntegerDistance o)
          Compares this distance with the specified distance for order.
 int externalizableSize()
          Retuns the number of Bytes this distance uses if it is written to an external file.
 double getDoubleValue()
          Returns the double value of this distance.
 int hashCode()
          The hashcode is the internal integer value of this distance.
 IntegerDistance minus(IntegerDistance distance)
          Returns a new Distance by subtracting the given distance from this distance.
 IntegerDistance plus(IntegerDistance distance)
          Returns a new distance as sum of this distance and the given distance.
 void readExternal(ObjectInput in)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.NumberDistance
description
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractDistance
equals
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.Distance
toString
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Created serial version UID.

See Also:
Constant Field Values

value

private int value
Constructor Detail

IntegerDistance

public IntegerDistance()

IntegerDistance

public IntegerDistance(int value)
Method Detail

getDoubleValue

public double getDoubleValue()
Description copied from class: NumberDistance
Returns the double value of this distance.

Specified by:
getDoubleValue in class NumberDistance<IntegerDistance>
Returns:
the double value of this distance
See Also:
NumberDistance.getDoubleValue()

hashCode

public int hashCode()
The hashcode is the internal integer value of this distance.

Specified by:
hashCode in class AbstractDistance<IntegerDistance>
See Also:
AbstractDistance.hashCode()

externalizableSize

public int externalizableSize()
Description copied from interface: Distance
Retuns the number of Bytes this distance uses if it is written to an external file.

Returns:
the number of Bytes this distance uses if it is written to an external file
See Also:
Distance.externalizableSize()

minus

public IntegerDistance minus(IntegerDistance distance)
Description copied from interface: Distance
Returns a new Distance by subtracting the given distance from this distance.

Parameters:
distance - the distance to be subtracted from this distance
Returns:
a new Distance by subtracting the given distance from this distance
See Also:
Distance.minus(de.lmu.ifi.dbs.elki.distance.Distance)

plus

public IntegerDistance plus(IntegerDistance distance)
Description copied from interface: Distance
Returns a new distance as sum of this distance and the given distance.

Parameters:
distance - the distancce to be added to this distance
Returns:
a new distance as sum of this distance and the given distance
See Also:
Distance.plus(de.lmu.ifi.dbs.elki.distance.Distance)

compareTo

public int compareTo(IntegerDistance o)
Compares this distance with the specified distance for order. Returns a negative integer, zero, or a positive integer as this distance is less than, equal to, or greater than the specified distance.

See Also:
Comparable.compareTo(java.lang.Object)

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Throws:
IOException
See Also:
Externalizable.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Throws:
IOException
See Also:
Externalizable.writeExternal(java.io.ObjectOutput)

Release 0.1 (2008-07-10_1838)