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_LENGTH
TYPE
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, wait
byteValue, floatValue, getMax, getMin, getValue, intValue, shortValue
toString
private 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()
LeafEntry
public int getDimensionality()
SpatialComparable
getDimensionality
in interface FeatureVector<java.lang.Number>
getDimensionality
in interface SpatialComparable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- 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.Externalizable
in
- 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)
NumberVector
getValue(dim).doubleValue()
, but usually this is much more
efficient due to boxing/unboxing cost.doubleValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
public long longValue(int dimension)
NumberVector
getValue(dim).longValue()
, but usually this is much more efficient
due to boxing/unboxing cost.longValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
public double[] toArray()
NumberVector
toArray
in interface NumberVector
double[]
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2019 ELKI Development Team. License information.