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,N>,N extends Number>

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,N>
Type Parameters:
D - Distance type
N - Number type
All Implemented Interfaces:
Entry, RdKNNEntry<D,N>, SpatialComparable, SpatialEntry, Externalizable, Serializable

public class RdKNNDirectoryEntry<D extends NumberDistance<D,N>,N extends Number>
extends SpatialDirectoryEntry
implements RdKNNEntry<D,N>

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.
private static long serialVersionUID
           
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

knnDistance

private D extends NumberDistance<D,N> 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 minimum 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,N>,N extends Number>
Returns:
the knn distance of this entry

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,N>,N extends Number>
Parameters:
knnDistance - the knn distance to be set

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.2.1 (2009-07-13_1605)