Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rdknn
Class RdKNNLeafEntry<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.SpatialLeafEntry
          extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rdknn.RdKNNLeafEntry<D,N>
Type Parameters:
D - Distance type
N - Number type
All Implemented Interfaces:
Entry, RdKNNEntry<D,N>, SpatialComparable, SpatialEntry, Externalizable, Serializable

public class RdKNNLeafEntry<D extends NumberDistance<D,N>,N extends Number>
extends SpatialLeafEntry
implements RdKNNEntry<D,N>

Represents an entry in a leaf node of an RdKNN-Tree. Additionally to a SpatialLeafEntry a RdKNNLeafEntry holds the knn distance of the underlying data object.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
private  D knnDistance
          The knn distance of the underlying data object.
private static long serialVersionUID
           
 
Constructor Summary
RdKNNLeafEntry()
          Empty constructor for serialization purposes.
RdKNNLeafEntry(int id, double[] values, D knnDistance)
          Constructs a new RDkNNLeafEntry 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.SpatialLeafEntry
getDimensionality, getMax, getMBR, getMin, getValues, 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 knn distance of the underlying data object.

Constructor Detail

RdKNNLeafEntry

public RdKNNLeafEntry()
Empty constructor for serialization purposes.


RdKNNLeafEntry

public RdKNNLeafEntry(int id,
                      double[] values,
                      D knnDistance)
Constructs a new RDkNNLeafEntry object with the given parameters.

Parameters:
id - the unique id of the underlying data object
values - the values of the underlying data object
knnDistance - the knn distance of the underlying data object
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 SpatialLeafEntry
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 SpatialLeafEntry
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 RDkNNLeafEntry and has the same knnDistance as this entry.

Release 0.2.1 (2009-07-13_1605)