de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mktab
Class MkTabLeafEntry<D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeLeafEntry<D>
          extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mktab.MkTabLeafEntry<D>
All Implemented Interfaces:
Entry, LeafEntry, MkTabEntry<D>, MTreeEntry<D>, Externalizable, Serializable

 class MkTabLeafEntry<D extends Distance<D>>
extends MTreeLeafEntry<D>
implements MkTabEntry<D>

Represents an entry in a leaf node of a MkTab-Tree. Additionally to a MTreeLeafEntry a MkTabLeafEntry 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 knn distances of the underlying data object.
private static long serialVersionUID
           
 
Constructor Summary
MkTabLeafEntry()
          Empty constructor for serialization purposes.
MkTabLeafEntry(DBID objectID, D parentDistance, List<D> knnDistances)
          Provides a new MkMaxLeafEntry 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.MTreeLeafEntry
getCoveringRadius, getParentDistance, getRoutingObjectID, setCoveringRadius, setParentDistance, setRoutingObjectID
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
getDBID, hashCode, isLeafEntry, toString
 
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 knn distances of the underlying data object.

Constructor Detail

MkTabLeafEntry

public MkTabLeafEntry()
Empty constructor for serialization purposes.


MkTabLeafEntry

public MkTabLeafEntry(DBID objectID,
                      D parentDistance,
                      List<D> knnDistances)
Provides a new MkMaxLeafEntry 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
knnDistances - the knn distances of the underlying data object
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 MTreeLeafEntry<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 MTreeLeafEntry<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 MTreeLeafEntry<D extends Distance<D>>
Parameters:
o - the object to be tested
Returns:
true, if the super method returns true and o is an MkTabLeafEntry and has the same parameter k_max and knnDistances as this entry.

Release 0.4.0 (2011-09-20_1324)