Class RdKNNLeafEntry
- java.lang.Object
-
- elki.index.tree.spatial.SpatialPointLeafEntry
-
- elki.index.tree.spatial.rstarvariants.rdknn.RdKNNLeafEntry
-
- All Implemented Interfaces:
FeatureVector<java.lang.Number>
,NumberVector
,SpatialComparable
,LeafEntry
,RdKNNEntry
,SpatialEntry
,java.io.Externalizable
,java.io.Serializable
public class RdKNNLeafEntry extends SpatialPointLeafEntry implements RdKNNEntry
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.- Since:
- 0.1
- Author:
- Elke Achtert
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.data.NumberVector
NumberVector.Factory<V extends NumberVector>
-
-
Field Summary
Fields Modifier and Type Field Description private double
knnDistance
The knn distance of the underlying data object.private static long
serialVersionUID
-
Fields inherited from interface elki.data.FeatureVector
TYPE
-
Fields inherited from interface elki.data.NumberVector
ATTRIBUTE_SEPARATOR, FIELD, FIELD_1D, FIELD_2D, VARIABLE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description RdKNNLeafEntry()
Empty constructor for serialization purposes.RdKNNLeafEntry(DBID id, NumberVector vector, double knnDistance)
Constructs a new RDkNNLeafEntry object with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getKnnDistance()
Returns the knn distance of this entry.void
readExternal(java.io.ObjectInput in)
Calls the super method and reads the knn distance of this entry from the specified input stream.void
setKnnDistance(double knnDistance)
Sets the knn distance of this entry.void
writeExternal(java.io.ObjectOutput out)
Calls the super method and writes the knn distance of this entry to the specified stream.-
Methods inherited from class elki.index.tree.spatial.SpatialPointLeafEntry
doubleValue, equals, getDBID, getDimensionality, hashCode, longValue, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.data.FeatureVector
toString
-
Methods inherited from interface elki.data.NumberVector
byteValue, floatValue, getMax, getMin, getValue, intValue, shortValue
-
Methods inherited from interface elki.data.spatial.SpatialComparable
getDimensionality
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
knnDistance
private double knnDistance
The knn distance of the underlying data object.
-
-
Constructor Detail
-
RdKNNLeafEntry
public RdKNNLeafEntry()
Empty constructor for serialization purposes.
-
RdKNNLeafEntry
public RdKNNLeafEntry(DBID id, NumberVector vector, double knnDistance)
Constructs a new RDkNNLeafEntry object with the given parameters.- Parameters:
id
- the unique id of the underlying data objectvector
- the underlying data objectknnDistance
- the knn distance of the underlying data object
-
-
Method Detail
-
getKnnDistance
public double getKnnDistance()
Description copied from interface:RdKNNEntry
Returns the knn distance of this entry.- Specified by:
getKnnDistance
in interfaceRdKNNEntry
- Returns:
- the knn distance of this entry
-
setKnnDistance
public void setKnnDistance(double knnDistance)
Description copied from interface:RdKNNEntry
Sets the knn distance of this entry.- Specified by:
setKnnDistance
in interfaceRdKNNEntry
- Parameters:
knnDistance
- the knn distance to be set
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Calls the super method and writes the knn distance of this entry to the specified stream.- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classSpatialPointLeafEntry
- Parameters:
out
- the stream to write the object to- Throws:
java.io.IOException
- Includes any I/O exceptions that may occur
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Calls the super method and reads the knn distance of this entry from the specified input stream.- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classSpatialPointLeafEntry
- Parameters:
in
- the stream to read data from in order to restore the object- Throws:
java.io.IOException
- if I/O errors occurjava.lang.ClassNotFoundException
- If the class for an object being restored cannot be found.
-
-