Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rdknn
Class RdKNNDirectoryEntry<D extends NumberDistance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialDirectoryEntry
          extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rdknn.RdKNNDirectoryEntry<D>
All Implemented Interfaces:
Entry, RdKNNEntry<D>, SpatialComparable, SpatialEntry, Externalizable, Serializable

public class RdKNNDirectoryEntry<D extends NumberDistance<D>>
extends SpatialDirectoryEntry
implements RdKNNEntry<D>

Represents an entry in a directory node of an RdKNN-Tree. Additionally to a SpatialDirectoryEntry a RdKNNDirectoryEntry holds the knn distance of the underlying RdKNN-Tree node.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
private  D knnDistance
          The aggregated knn distance of this entry.
 
Constructor Summary
RdKNNDirectoryEntry()
          Empty constructor for serialization purposes.
RdKNNDirectoryEntry(int id, HyperBoundingBox mbr, D knnDistance)
          Constructs a new RDkNNDirectoryEntry object with the given parameters.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 D getKnnDistance()
          Returns the knn distance of this entry.
 void readExternal(ObjectInput in)
          Calls the super method and reads the knn distance of this entry from the specified input stream.
 void setKnnDistance(D knnDistance)
          Sets the knn distance of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the knn distance of this entry to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialDirectoryEntry
getDimensionality, getMax, getMBR, getMin, isLeafEntry, setMBR
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractEntry
getID, hashCode, setID, 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.spatial.SpatialEntry
getMBR, setMBR
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Entry
getID, isLeafEntry, setID
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialComparable
getDimensionality, getMax, getMin
 

Field Detail

knnDistance

private D extends NumberDistance<D> knnDistance
The aggregated knn distance of this entry.

Constructor Detail

RdKNNDirectoryEntry

public RdKNNDirectoryEntry()
Empty constructor for serialization purposes.


RdKNNDirectoryEntry

public RdKNNDirectoryEntry(int id,
                           HyperBoundingBox mbr,
                           D knnDistance)
Constructs a new RDkNNDirectoryEntry object with the given parameters.

Parameters:
id - the unique id of the underlying node
mbr - the minmum bounding rectangle of the underlying node
knnDistance - the aggregated knn distance of this entry
Method Detail

getKnnDistance

public D getKnnDistance()
Description copied from interface: RdKNNEntry
Returns the knn distance of this entry.

Specified by:
getKnnDistance in interface RdKNNEntry<D extends NumberDistance<D>>
Returns:
the knn distance of this entry
See Also:
RdKNNEntry.getKnnDistance()

setKnnDistance

public void setKnnDistance(D knnDistance)
Description copied from interface: RdKNNEntry
Sets the knn distance of this entry.

Specified by:
setKnnDistance in interface RdKNNEntry<D extends NumberDistance<D>>
Parameters:
knnDistance - the knn distance to be set
See Also:
RdKNNEntry.setKnnDistance(de.lmu.ifi.dbs.elki.distance.NumberDistance)

writeExternal

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

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class SpatialDirectoryEntry
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 knn distance of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class SpatialDirectoryEntry
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 AbstractEntry
Parameters:
o - the object to be tested
Returns:
true, if the super method returns true and o is an RDkNNDirectoryEntry and has the same knnDistance as this entry.

Release 0.1 (2008-07-10_1838)