de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mktab
Class MkTabDirectoryEntry<D extends Distance<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.mktab.MkTabDirectoryEntry<D>
All Implemented Interfaces:
DirectoryEntry, Entry, MkTabEntry<D>, MTreeEntry<D>, Externalizable, Serializable

 class MkTabDirectoryEntry<D extends Distance<D>>
extends MTreeDirectoryEntry<D>
implements MkTabEntry<D>

Represents an entry in a directory node of a MkTab-Tree. Additionally to a MTreeLeafEntry a MkTabDirectoryEntry holds a list of its knn distances for parameters k <= k_max.


Field Summary
private  int k_max
          The maximal number of knn distances to be stored.
private  List<D> knnDistances
          The aggregated knn distances of the underlying node.
private static long serialVersionUID
           
 
Constructor Summary
MkTabDirectoryEntry()
          Empty constructor for serialization purposes.
MkTabDirectoryEntry(DBID objectID, D parentDistance, Integer nodeID, D coveringRadius, List<D> knnDistances)
          Provides a new MkMaxDirectoryEntry with the given parameters.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 int getK_max()
          Returns the parameter k_max.
 D getKnnDistance(int k)
          Returns the knn distance of the entry for the specified parameter k.
 List<D> getKnnDistances()
          Returns the list of knn distances of the entry.
 void readExternal(ObjectInput in)
          Calls the super method and reads the parameter k_max and knn distance of this entry from the specified input stream.
 void setKnnDistances(List<D> knnDistances)
          Sets the knn distances of the entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the parameter k_max and 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

k_max

private int k_max
The maximal number of knn distances to be stored.


knnDistances

private List<D extends Distance<D>> knnDistances
The aggregated knn distances of the underlying node.

Constructor Detail

MkTabDirectoryEntry

public MkTabDirectoryEntry()
Empty constructor for serialization purposes.


MkTabDirectoryEntry

public MkTabDirectoryEntry(DBID objectID,
                           D parentDistance,
                           Integer nodeID,
                           D coveringRadius,
                           List<D> knnDistances)
Provides a new MkMaxDirectoryEntry with the given parameters.

Parameters:
objectID - the id of the routing object
parentDistance - the distance from the routing object of this entry to its parent's routing object
nodeID - the id of the underlying node
coveringRadius - the covering radius of the entry
knnDistances - the aggregated knn distances of the underlying node
Method Detail

getKnnDistances

public List<D> getKnnDistances()
Description copied from interface: MkTabEntry
Returns the list of knn distances of the entry.

Specified by:
getKnnDistances in interface MkTabEntry<D extends Distance<D>>
Returns:
the list of knn distances of the entry

setKnnDistances

public void setKnnDistances(List<D> knnDistances)
Description copied from interface: MkTabEntry
Sets the knn distances of the entry.

Specified by:
setKnnDistances in interface MkTabEntry<D extends Distance<D>>
Parameters:
knnDistances - the knn distances to be set

getKnnDistance

public D getKnnDistance(int k)
Description copied from interface: MkTabEntry
Returns the knn distance of the entry for the specified parameter k.

Specified by:
getKnnDistance in interface MkTabEntry<D extends Distance<D>>
Parameters:
k - the parameter k of the knn distance
Returns:
the knn distance of the entry

getK_max

public int getK_max()
Description copied from interface: MkTabEntry
Returns the parameter k_max.

Specified by:
getK_max in interface MkTabEntry<D extends Distance<D>>
Returns:
the parameter k_max

writeExternal

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

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class MTreeDirectoryEntry<D extends Distance<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 parameter k_max and knn distance of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class MTreeDirectoryEntry<D extends Distance<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 Distance<D>>
Parameters:
o - the object to be tested
Returns:
true, if the super method returns true and o is an MkTabDirectoryEntry and has the same parameter k_max and knnDistances as this entry.

Release 0.4.0 (2011-09-20_1324)