Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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<BitDistance>
              extended by de.lmu.ifi.dbs.elki.distance.BitDistance
All Implemented Interfaces:
Distance<BitDistance>, Loggable, Externalizable, Serializable, Comparable<BitDistance>

public class BitDistance
extends NumberDistance<BitDistance>

TODO arthur comment

Author:
Arthur Zimek
See Also:
Serialized Form

Field Summary
private  boolean bit
          The bit value of this distance.
private static long serialVersionUID
          Generated serial version UID
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
BitDistance()
           
BitDistance(boolean bit)
           
 
Method Summary
 int compareTo(BitDistance o)
           
 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()
          Any extending class should implement a proper hashCode method.
 boolean isBit()
           
 BitDistance minus(BitDistance distance)
          Returns a new Distance by subtracting the given distance from this distance.
 BitDistance plus(BitDistance distance)
          Returns a new distance as sum of this distance and the given distance.
 void readExternal(ObjectInput in)
           
 String toString()
          Returns a string representation of the object.
 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, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated serial version UID

See Also:
Constant Field Values

bit

private boolean bit
The bit value of this distance.

Constructor Detail

BitDistance

public BitDistance()

BitDistance

public BitDistance(boolean bit)
Method Detail

getDoubleValue

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

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

hashCode

public int hashCode()
Description copied from class: AbstractDistance
Any extending class should implement a proper hashCode method.

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

plus

public BitDistance plus(BitDistance 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(Distance)

minus

public BitDistance minus(BitDistance 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(Distance)

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()

compareTo

public int compareTo(BitDistance o)
See Also:
Comparable.compareTo(Object)

writeExternal

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

readExternal

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

isBit

public boolean isBit()

toString

public String toString()
Returns a string representation of the object.

Specified by:
toString in interface Distance<BitDistance>
Overrides:
toString in class Object
Returns:
a string representation of the object.

Release 0.1 (2008-07-10_1838)