de.lmu.ifi.dbs.elki.index.tree.spatial
Class SpatialPointLeafEntry

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialPointLeafEntry
All Implemented Interfaces:
SpatialComparable, Entry, LeafEntry, SpatialEntry, Externalizable, Serializable
Direct Known Subclasses:
DeLiCluLeafEntry

public class SpatialPointLeafEntry
extends AbstractLeafEntry
implements SpatialEntry

Represents an entry in a leaf node of a spatial index. A SpatialLeafEntry consists of an id (representing the unique id of the underlying data object) and the values of the underlying data object.

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
private  double[] values
          The values of the underlying data object.
 
Constructor Summary
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
 
Method Summary
 int getDimensionality()
          Returns the dimensionality of the object.
 double getMax(int dimension)
          Returns the maximum coordinate at the specified dimension.
 double getMin(int dimension)
          Returns the minimum coordinate at the specified dimension.
 double[] getValues()
          Returns the values of the underlying data object of this entry.
 void readExternal(ObjectInput in)
          Calls the super method and reads the values of this entry from the specified input stream.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the values of this entry to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
equals, getDBID, hashCode, isLeafEntry, 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.Entry
isLeafEntry
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

values

private double[] values
The values of the underlying data object.

Constructor Detail

SpatialPointLeafEntry

public SpatialPointLeafEntry()
Empty constructor for serialization purposes.


SpatialPointLeafEntry

public SpatialPointLeafEntry(DBID id,
                             double[] values)
Constructs a new LeafEntry object with the given parameters.

Parameters:
id - the unique id of the underlying data object
values - the values of the underlying data object

SpatialPointLeafEntry

public SpatialPointLeafEntry(DBID id,
                             NumberVector<?,?> vector)
Constructor from number vector

Parameters:
id - Object id
vector - Number vector
Method Detail

getDimensionality

public int getDimensionality()
Description copied from interface: SpatialComparable
Returns the dimensionality of the object.

Specified by:
getDimensionality in interface SpatialComparable
Returns:
the dimensionality

getMin

public double getMin(int dimension)
Description copied from interface: SpatialComparable
Returns the minimum coordinate at the specified dimension.

Specified by:
getMin in interface SpatialComparable
Parameters:
dimension - the dimension for which the coordinate should be returned, where 1 ≤ dimension ≤ getDimensionality()
Returns:
the value at the specified dimension

getMax

public double getMax(int dimension)
Description copied from interface: SpatialComparable
Returns the maximum coordinate at the specified dimension.

Specified by:
getMax in interface SpatialComparable
Parameters:
dimension - the dimension for which the coordinate should be returned, where 1 ≤ dimension ≤ getDimensionality()
Returns:
the value at the specified dimension

getValues

public double[] getValues()
Returns the values of the underlying data object of this entry.

Returns:
the values of the underlying data object of this entry

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Calls the super method and writes the values of this entry to the specified stream.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractLeafEntry
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 values of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractLeafEntry
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.

Release 0.4.0 (2011-09-20_1324)