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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractDirectoryEntry
      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>
All Implemented Interfaces:
DirectoryEntry, Entry, MkCoPEntry<D>, MTreeEntry<D>, Externalizable, Serializable

 class MkCoPDirectoryEntry<D extends NumberDistance<D,?>>
extends MTreeDirectoryEntry<D>
implements MkCoPEntry<D>

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.


Field Summary
private  ApproximationLine conservativeApproximation
          The conservative approximation.
private static long serialVersionUID
           
 
Constructor Summary
MkCoPDirectoryEntry()
          Empty constructor for serialization purposes.
MkCoPDirectoryEntry(DBID objectID, D parentDistance, Integer nodeID, D coveringRadius, ApproximationLine conservativeApproximation)
          Provides a new MkCoPDirectoryEntry with the given parameters.
 
Method Summary
<O> D
approximateConservativeKnnDistance(int k, DistanceQuery<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, setCoveringRadius, setParentDistance, setRoutingObjectID, toString
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractDirectoryEntry
getEntryID, getPageID, hashCode, isLeafEntry
 
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
isLeafEntry
 

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(DBID 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> D approximateConservativeKnnDistance(int k,
                                                DistanceQuery<O,D> distanceFunction)
Returns the conservative approximated knn distance of the entry.

Specified by:
approximateConservativeKnnDistance in interface MkCoPEntry<D extends NumberDistance<D,?>>
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,?>>
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,?>>
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,?>>
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,?>>
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,?>>
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.4.0 (2011-09-20_1324)