public class SpatialPointLeafEntry extends java.lang.Object implements LeafEntry, SpatialEntry, NumberVector
NumberVector.Factory<V extends NumberVector>| Modifier and Type | Field and Description |
|---|---|
private DBID |
id
Holds the id of the object (node or data object) represented by this entry.
|
private static long |
serialVersionUID
Serial version.
|
private double[] |
values
The values of the underlying data object.
|
ATTRIBUTE_SEPARATOR, FIELD, FIELD_1D, FIELD_2D, VARIABLE_LENGTHTYPE| Constructor and Description |
|---|
SpatialPointLeafEntry()
Empty constructor for serialization purposes.
|
SpatialPointLeafEntry(DBID id,
double[] values)
Constructs a new LeafEntry object with the given parameters.
|
SpatialPointLeafEntry(DBID id,
NumberVector vector)
Constructor from number vector.
|
| Modifier and Type | Method and Description |
|---|---|
double |
doubleValue(int dimension)
Returns the value in the specified dimension as double.
|
boolean |
equals(java.lang.Object obj) |
DBID |
getDBID()
Get the DBID of this leaf entry.
|
int |
getDimensionality()
Returns the dimensionality of the object.
|
int |
hashCode() |
long |
longValue(int dimension)
Returns the value in the specified dimension as long.
|
void |
readExternal(java.io.ObjectInput in)
Calls the super method and reads the values of this entry from the
specified input stream.
|
double[] |
toArray()
Returns a double array copy of this vector.
|
void |
writeExternal(java.io.ObjectOutput out)
Calls the super method and writes the values of this entry to the specified
stream.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitbyteValue, floatValue, getMax, getMin, getValue, intValue, shortValuetoStringprivate static final long serialVersionUID
private DBID id
private double[] values
public SpatialPointLeafEntry()
public SpatialPointLeafEntry(DBID id, double[] values)
id - the unique id of the underlying data objectvalues - the values of the underlying data objectpublic SpatialPointLeafEntry(DBID id, NumberVector vector)
id - Object idvector - Number vectorpublic DBID getDBID()
LeafEntrypublic int getDimensionality()
SpatialComparablegetDimensionality in interface FeatureVector<java.lang.Number>getDimensionality in interface SpatialComparablepublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - the stream to write the object tojava.io.IOException - Includes any I/O exceptions that may occurpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - the stream to read data from in order to restore the objectjava.io.IOException - if I/O errors occurjava.lang.ClassNotFoundException - If the class for an object being restored
cannot be found.public double doubleValue(int dimension)
NumberVectorgetValue(dim).doubleValue(), but usually this is much more
efficient due to boxing/unboxing cost.doubleValue in interface NumberVectordimension - the desired dimension, where 0 ≤ dimension <
this.getDimensionality()public long longValue(int dimension)
NumberVectorgetValue(dim).longValue(), but usually this is much more efficient
due to boxing/unboxing cost.longValue in interface NumberVectordimension - the desired dimension, where 0 ≤ dimension <
this.getDimensionality()public double[] toArray()
NumberVectortoArray in interface NumberVectordouble[]public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2019 ELKI Development Team. License information.