Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkcop
Class MkCoPDirectoryEntry<D extends NumberDistance<D,N>,N extends Number>

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

 class MkCoPDirectoryEntry<D extends NumberDistance<D,N>,N extends Number>
extends MTreeDirectoryEntry<D>
implements MkCoPEntry<D,N>

Represents an entry in a directory node of an MkCop-Tree. Additionally to an MTreeDirectoryEntry an MkCoPLeafEntry holds the conservative approximation of its knn-distances.

Author:
Elke Achtert

Field Summary
private  ApproximationLine conservativeApproximation
          The conservative approximation.
private static long serialVersionUID
           
 
Constructor Summary
MkCoPDirectoryEntry()
          Empty constructor for serialization purposes.
MkCoPDirectoryEntry(Integer objectID, D parentDistance, Integer nodeID, D coveringRadius, ApproximationLine conservativeApproximation)
          Provides a new MkCoPDirectoryEntry 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.
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 ApproximationLine getConservativeKnnDistanceApproximation()
          Returns the conservative approximation line.
 void readExternal(ObjectInput in)
          Calls the super method and reads the the conservative approximation of the knn distances of this entry from the specified input stream.
 void setConservativeKnnDistanceApproximation(ApproximationLine conservativeApproximation)
          Sets the conservative approximation line
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the conservative 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.MTreeDirectoryEntry
getCoveringRadius, getParentDistance, getRoutingObjectID, isLeafEntry, setCoveringRadius, setParentDistance, setRoutingObjectID, toString
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

conservativeApproximation

private ApproximationLine conservativeApproximation
The conservative approximation.

Constructor Detail

MkCoPDirectoryEntry

public MkCoPDirectoryEntry()
Empty constructor for serialization purposes.


MkCoPDirectoryEntry

public MkCoPDirectoryEntry(Integer objectID,
                           D parentDistance,
                           Integer nodeID,
                           D coveringRadius,
                           ApproximationLine conservativeApproximation)
Provides a new MkCoPDirectoryEntry with the given parameters.

Parameters:
objectID - the id of the routing object
parentDistance - the distance from the object to its parent
nodeID - the id of the underlying node
coveringRadius - the covering radius of the entry
conservativeApproximation - the conservative 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,N>,N extends Number>
Type Parameters:
O - Object type
Parameters:
k - the parameter k of the knn distance
distanceFunction - the distance function
Returns:
the conservative 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,N>,N extends Number>
Returns:
the conservative approximation line

setConservativeKnnDistanceApproximation

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

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

writeExternal

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

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class MTreeDirectoryEntry<D extends NumberDistance<D,N>>
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 approximation of the knn distances of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class MTreeDirectoryEntry<D extends NumberDistance<D,N>>
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 MTreeDirectoryEntry<D extends NumberDistance<D,N>>
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 approximation as this entry.

Release 0.2 (2009-07-06_1820)