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.distance.AbstractDistance<D>
      extended by de.lmu.ifi.dbs.elki.distance.NumberDistance<IntegerDistance,Integer>
          extended by de.lmu.ifi.dbs.elki.distance.IntegerDistance
All Implemented Interfaces:
Distance<IntegerDistance>, Externalizable, Serializable, Comparable<IntegerDistance>

public class IntegerDistance
extends NumberDistance<IntegerDistance,Integer>

Author:
Arthur Zimek
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Created serial version UID.
 
Constructor Summary
IntegerDistance()
          Empty constructor for serialization purposes.
IntegerDistance(int value)
          Constructor
 
Method Summary
 String description()
          Returns a String as description of this Distance.
 int externalizableSize()
          Returns the number of Bytes this distance uses if it is written to an external file.
 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)
          Reads the integer value of this IntegerDistance from the specified stream.
 void writeExternal(ObjectOutput out)
          Writes the integer value of this IntegerDistance to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.NumberDistance
compareTo, getValue, hashCode, setValue, toString
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractDistance
equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Created serial version UID.

See Also:
Constant Field Values
Constructor Detail

IntegerDistance

public IntegerDistance()
Empty constructor for serialization purposes.


IntegerDistance

public IntegerDistance(int value)
Constructor

Parameters:
value - distance value
Method Detail

description

public String description()
Description copied from interface: Distance
Returns a String as description of this Distance.

Returns:
a String as description of this Distance

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

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 distance to be added to this distance
Returns:
a new distance as sum of this distance and the given distance

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Writes the integer value of this IntegerDistance to the specified stream.

Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Reads the integer value of this IntegerDistance from the specified stream.

Throws:
IOException

externalizableSize

public int externalizableSize()
Returns the number of Bytes this distance uses if it is written to an external file.

Returns:
4 (4 Byte for an integer value)

Release 0.2.1 (2009-07-13_1605)