Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mkcop
Class MkCoPLeafEntry<D extends NumberDistance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeLeafEntry<D>
          extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mkcop.MkCoPLeafEntry<D>
All Implemented Interfaces:
Entry, MetricalEntry, MkCoPEntry<D>, MTreeEntry<D>, Externalizable, Serializable

 class MkCoPLeafEntry<D extends NumberDistance<D>>
extends MTreeLeafEntry<D>
implements MkCoPEntry<D>

Represents an entry in a leaf node of a MkCoP-Tree. Additionally to an MTreeLeafEntry an MkCoPLeafEntry holds the conservative and progressive approximation of its knn-distances.

Author:
Elke Achtert

Field Summary
private  ApproximationLine conservativeApproximation
          The conservative approximation.
private  ApproximationLine progressiveApproximation
          The progressive approximation.
 
Constructor Summary
MkCoPLeafEntry()
          Empty constructor for serialization purposes.
MkCoPLeafEntry(Integer objectID, D parentDistance, ApproximationLine conservativeApproximation, ApproximationLine progressiveApproximation)
          Provides a new MkCoPLeafEntry with the given parameters.
 
Method Summary
<O extends DatabaseObject>
D
approximateConservativeKnnDistance(int k, DistanceFunction<O,D> distanceFunction)
          Returns the conservative approximated knn distance of the entry.
<O extends DatabaseObject>
D
approximateProgressiveKnnDistance(int k, DistanceFunction<O,D> distanceFunction)
          Returns the progressive approximated knn distance of the entry.
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 ApproximationLine getConservativeKnnDistanceApproximation()
          Returns the conservative approximation line.
 ApproximationLine getProgressiveKnnDistanceApproximation()
          Returns the progressive approximation line.
 void readExternal(ObjectInput in)
          Calls the super method and reads the the conservative and progressive approximation of the knn distances of this entry from the specified input stream.
 void setConservativeKnnDistanceApproximation(ApproximationLine conservativeApproximation)
          Sets the conservative approximation line
 void setProgressiveKnnDistanceApproximation(ApproximationLine progressiveApproximation)
          Sets the progressive approximation line
 String toString()
          Returns a string representation of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the conservative and progressive approximation of the knn distances of this entry to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeLeafEntry
getCoveringRadius, getParentDistance, getRoutingObjectID, isLeafEntry, setCoveringRadius, setParentDistance, setRoutingObjectID
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractEntry
getID, hashCode, setID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeEntry
getCoveringRadius, getParentDistance, getRoutingObjectID, setCoveringRadius, setParentDistance, setRoutingObjectID
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Entry
getID, isLeafEntry, setID
 

Field Detail

conservativeApproximation

private ApproximationLine conservativeApproximation
The conservative approximation.


progressiveApproximation

private ApproximationLine progressiveApproximation
The progressive approximation.

Constructor Detail

MkCoPLeafEntry

public MkCoPLeafEntry()
Empty constructor for serialization purposes.


MkCoPLeafEntry

public MkCoPLeafEntry(Integer objectID,
                      D parentDistance,
                      ApproximationLine conservativeApproximation,
                      ApproximationLine progressiveApproximation)
Provides a new MkCoPLeafEntry with the given parameters.

Parameters:
objectID - the id of the underlying data object
parentDistance - the distance from the underlying data object to its parent's routing object
conservativeApproximation - the conservative approximation of the knn distances
progressiveApproximation - the progressive approximation of the knn distances
Method Detail

approximateConservativeKnnDistance

public <O extends DatabaseObject> D approximateConservativeKnnDistance(int k,
                                                                       DistanceFunction<O,D> distanceFunction)
Returns the conservative approximated knn distance of the entry.

Specified by:
approximateConservativeKnnDistance in interface MkCoPEntry<D extends NumberDistance<D>>
Parameters:
k - the parameter k of the knn distance
distanceFunction - the distance function
Returns:
the conservative approximated knn distance of the entry

approximateProgressiveKnnDistance

public <O extends DatabaseObject> D approximateProgressiveKnnDistance(int k,
                                                                      DistanceFunction<O,D> distanceFunction)
Returns the progressive approximated knn distance of the entry.

Parameters:
k - the parameter k of the knn distance
distanceFunction - the distance function
Returns:
the progressive approximated knn distance of the entry

getConservativeKnnDistanceApproximation

public ApproximationLine getConservativeKnnDistanceApproximation()
Returns the conservative approximation line.

Specified by:
getConservativeKnnDistanceApproximation in interface MkCoPEntry<D extends NumberDistance<D>>
Returns:
the conservative approximation line

getProgressiveKnnDistanceApproximation

public ApproximationLine getProgressiveKnnDistanceApproximation()
Returns the progressive approximation line.

Returns:
the progressive approximation line

setConservativeKnnDistanceApproximation

public void setConservativeKnnDistanceApproximation(ApproximationLine conservativeApproximation)
Sets the conservative approximation line

Specified by:
setConservativeKnnDistanceApproximation in interface MkCoPEntry<D extends NumberDistance<D>>
Parameters:
conservativeApproximation - the conservative approximation line to be set

setProgressiveKnnDistanceApproximation

public void setProgressiveKnnDistanceApproximation(ApproximationLine progressiveApproximation)
Sets the progressive approximation line

Parameters:
progressiveApproximation - the progressive approximation line to be set

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Calls the super method and writes the conservative and progressive approximation of the knn distances of this entry to the specified stream.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class MTreeLeafEntry<D extends NumberDistance<D>>
Parameters:
out - the stream to write the object to
Throws:
IOException - Includes any I/O exceptions that may occur

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Calls the super method and reads the the conservative and progressive approximation of the knn distances of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class MTreeLeafEntry<D extends NumberDistance<D>>
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being restored cannot be found.

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class MTreeLeafEntry<D extends NumberDistance<D>>
Parameters:
o - the object to be tested
Returns:
true, if the super method returns true and o is an MkCoPLeafEntry and has the same conservative and progressive approximation as this entry.

toString

public String toString()
Returns a string representation of this entry.

Overrides:
toString in class AbstractEntry
Returns:
a string representation of this entry

Release 0.1 (2008-07-10_1838)