de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkapp
Class MkAppLeafEntry<D extends NumberDistance<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.mkapp.MkAppLeafEntry<D>
All Implemented Interfaces:
Entry, LeafEntry, MkAppEntry<D>, MTreeEntry<D>, Externalizable, Serializable

 class MkAppLeafEntry<D extends NumberDistance<D,?>>
extends MTreeLeafEntry<D>
implements MkAppEntry<D>

Represents an entry in a leaf node of a MkApp-Tree. Additionally to an MTreeLeafEntry an MkAppLeafEntry holds the polynomial approximation of its knn-distances.


Field Summary
private  PolynomialApproximation approximation
          The polynomial approximation.
private static long serialVersionUID
          Serial Version UID
 
Constructor Summary
MkAppLeafEntry()
          Empty constructor for serialization purposes.
MkAppLeafEntry(DBID objectID, D parentDistance, PolynomialApproximation approximation)
          Provides a new MkAppLeafEntry with the given parameters.
 
Method Summary
 double approximatedValueAt(int k)
          Returns the approximated value at the specified k.
 PolynomialApproximation getKnnDistanceApproximation()
          Returns the polynomial approximation.
 void readExternal(ObjectInput in)
          Calls the super method and reads the the polynomial approximation of the knn distances of this entry from the specified input stream.
 void setKnnDistanceApproximation(PolynomialApproximation approximation)
          Sets the polynomial approximation.
 String toString()
          Returns a string representation of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the polynomiale 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
equals, getCoveringRadius, getParentDistance, getRoutingObjectID, setCoveringRadius, setParentDistance, setRoutingObjectID
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
getDBID, 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
Serial Version UID

See Also:
Constant Field Values

approximation

private PolynomialApproximation approximation
The polynomial approximation.

Constructor Detail

MkAppLeafEntry

public MkAppLeafEntry()
Empty constructor for serialization purposes.


MkAppLeafEntry

public MkAppLeafEntry(DBID objectID,
                      D parentDistance,
                      PolynomialApproximation approximation)
Provides a new MkAppLeafEntry 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
approximation - the polynomial approximation of the knn distances
Method Detail

approximatedValueAt

public double approximatedValueAt(int k)
Returns the approximated value at the specified k.

Specified by:
approximatedValueAt in interface MkAppEntry<D extends NumberDistance<D,?>>
Parameters:
k - the parameter k of the knn distance
Returns:
the approximated value at the specified k

getKnnDistanceApproximation

public PolynomialApproximation getKnnDistanceApproximation()
Returns the polynomial approximation.

Specified by:
getKnnDistanceApproximation in interface MkAppEntry<D extends NumberDistance<D,?>>
Returns:
the polynomial approximation

setKnnDistanceApproximation

public void setKnnDistanceApproximation(PolynomialApproximation approximation)
Sets the polynomial approximation.

Specified by:
setKnnDistanceApproximation in interface MkAppEntry<D extends NumberDistance<D,?>>
Parameters:
approximation - the polynomial approximation to be set

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Calls the super method and writes the polynomiale 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 polynomial 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.

toString

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

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

Release 0.4.0 (2011-09-20_1324)