Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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

public class SpatialDirectoryEntry
extends AbstractEntry
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 minmum bounding rectangle of the underlying spatial node.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
private  HyperBoundingBox mbr
          The minmum bounding rectangle of the underlying spatial node.
 
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.
 HyperBoundingBox getMBR()
          Returns the MBR of the underlying spatial object of this entry.
 double getMin(int dimension)
          Returns the minimum coordinate at the specified dimension.
 boolean isLeafEntry()
          Returns true if this entry is an entry in a leaf node (i.e. this entry represents a data object), false otherwise.
 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.AbstractEntry
equals, getID, hashCode, setID, 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
getID, setID
 

Field Detail

mbr

private HyperBoundingBox mbr
The minmum 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 minmum bounding rectangle of the underlying spatial node
Method Detail

isLeafEntry

public boolean isLeafEntry()
Description copied from interface: Entry
Returns true if this entry is an entry in a leaf node (i.e. this entry represents a data object), false otherwise.

Specified by:
isLeafEntry in interface Entry
Returns:
false
See Also:
Entry.isLeafEntry()

getMBR

public HyperBoundingBox getMBR()
Description copied from interface: SpatialEntry
Returns the MBR of the underlying spatial object of this entry.

Specified by:
getMBR in interface SpatialEntry
Returns:
the MBR of the underlying spatial node
See Also:
SpatialEntry.getMBR()

getDimensionality

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

Specified by:
getDimensionality in interface SpatialComparable
Returns:
the dimensionality
See Also:
SpatialComparable.getDimensionality()

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
See Also:
SpatialComparable.getMin(int)

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
See Also:
SpatialComparable.getMax(int)

setMBR

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

Specified by:
setMBR in interface SpatialEntry
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 AbstractEntry
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 AbstractEntry
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.1 (2008-07-10_1838)