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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractDirectoryEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialDirectoryEntry
All Implemented Interfaces:
SpatialComparable, DirectoryEntry, Entry, SpatialEntry, Externalizable, Serializable
Direct Known Subclasses:
DeLiCluDirectoryEntry

public class SpatialDirectoryEntry
extends AbstractDirectoryEntry
implements SpatialEntry

Represents an entry in a directory node of a spatial index. A SpatialDirectoryEntry consists of an id (representing the unique id of the underlying spatial node) and the minimum bounding rectangle of the underlying spatial node.

See Also:
Serialized Form

Field Summary
private  HyperBoundingBox mbr
          The minimum bounding rectangle of the underlying spatial node.
private static long serialVersionUID
           
 
Constructor Summary
SpatialDirectoryEntry()
          Empty constructor for serialization purposes.
SpatialDirectoryEntry(int id, HyperBoundingBox mbr)
          Constructs a new SpatialDirectoryEntry object with the given parameters.
 
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.
 void readExternal(ObjectInput in)
          Calls the super method and reads the MBR object of this entry from the specified input stream.
 void setMBR(HyperBoundingBox mbr)
          Sets the MBR of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the MBR object of this entry to the specified output stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractDirectoryEntry
equals, getEntryID, getPageID, 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

mbr

private HyperBoundingBox mbr
The minimum bounding rectangle of the underlying spatial node.

Constructor Detail

SpatialDirectoryEntry

public SpatialDirectoryEntry()
Empty constructor for serialization purposes.


SpatialDirectoryEntry

public SpatialDirectoryEntry(int id,
                             HyperBoundingBox mbr)
Constructs a new SpatialDirectoryEntry object with the given parameters.

Parameters:
id - the unique id of the underlying spatial node
mbr - the minimum bounding rectangle of the underlying spatial node
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 coordinate at the specified dimension of the minimum hyper point of the MBR of the underlying node

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 coordinate at the specified dimension of the maximum hyper point of the MBR of the underlying node

setMBR

public void setMBR(HyperBoundingBox mbr)
Sets the MBR of this entry.

Parameters:
mbr - the MBR to be set

writeExternal

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

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

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