Package elki.index.tree.spatial
Class SpatialDirectoryEntry
- java.lang.Object
-
- elki.index.tree.spatial.SpatialDirectoryEntry
-
- All Implemented Interfaces:
SpatialComparable,DirectoryEntry,SpatialEntry,java.io.Externalizable,java.io.Serializable
- Direct Known Subclasses:
DeLiCluDirectoryEntry,RdKNNDirectoryEntry
public class SpatialDirectoryEntry extends java.lang.Object implements DirectoryEntry, 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.- Since:
- 0.1
- Author:
- Elke Achtert
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intidHolds the id of the object (node or data object) represented by this entry.private ModifiableHyperBoundingBoxmbrThe minimum bounding rectangle of the underlying spatial node.private static longserialVersionUIDSerialization version.
-
Constructor Summary
Constructors Constructor Description SpatialDirectoryEntry()Empty constructor for serialization purposes.SpatialDirectoryEntry(int id, ModifiableHyperBoundingBox mbr)Constructs a new SpatialDirectoryEntry object with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)booleanextendMBR(SpatialComparable responsibleMBR)Extend the MBR of this node.intgetDimensionality()Returns the dimensionality of the object.doublegetMax(int dimension)Returns the maximum coordinate at the specified dimension.doublegetMin(int dimension)Returns the minimum coordinate at the specified dimension.intgetPageID()Get the page ID of this directory entry.inthashCode()booleanhasMBR()Test whether this entry already has an MBR.voidreadExternal(java.io.ObjectInput in)Calls the super method and reads the MBR object of this entry from the specified input stream.voidsetMBR(ModifiableHyperBoundingBox mbr)Sets the MBR of this entry.java.lang.StringtoString()voidwriteExternal(java.io.ObjectOutput out)Calls the super method and writes the MBR object of this entry to the specified output stream.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serialization version.- See Also:
- Constant Field Values
-
id
private int id
Holds the id of the object (node or data object) represented by this entry.
-
mbr
private ModifiableHyperBoundingBox 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, ModifiableHyperBoundingBox mbr)Constructs a new SpatialDirectoryEntry object with the given parameters.- Parameters:
id- the unique id of the underlying spatial nodembr- the minimum bounding rectangle of the underlying spatial node
-
-
Method Detail
-
getPageID
public int getPageID()
Description copied from interface:DirectoryEntryGet the page ID of this directory entry.- Specified by:
getPageIDin interfaceDirectoryEntry
-
getDimensionality
public int getDimensionality()
Description copied from interface:SpatialComparableReturns the dimensionality of the object.- Specified by:
getDimensionalityin interfaceSpatialComparable- Returns:
- the dimensionality
-
getMin
public double getMin(int dimension)
Description copied from interface:SpatialComparableReturns the minimum coordinate at the specified dimension.- Specified by:
getMinin interfaceSpatialComparable- Parameters:
dimension- the dimension for which the coordinate should be returned, where 0 ≤ 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:SpatialComparableReturns the maximum coordinate at the specified dimension.- Specified by:
getMaxin interfaceSpatialComparable- Parameters:
dimension- the dimension for which the coordinate should be returned, where 0 ≤ dimension <getDimensionality()- Returns:
- the coordinate at the specified dimension of the maximum hyper point of the MBR of the underlying node
-
hasMBR
public boolean hasMBR()
Test whether this entry already has an MBR.- Returns:
- True when an MBR exists.
-
setMBR
public void setMBR(ModifiableHyperBoundingBox mbr)
Sets the MBR of this entry.- Parameters:
mbr- the MBR to be set
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionCalls the super method and writes the MBR object of this entry to the specified output stream.- Specified by:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- the stream to write the object to- Throws:
java.io.IOException- Includes any I/O exceptions that may occur
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionCalls the super method and reads the MBR object of this entry from the specified input stream.- Specified by:
readExternalin interfacejava.io.Externalizable- Parameters:
in- the stream to read data from in order to restore the object- Throws:
java.io.IOException- if I/O errors occurjava.lang.ClassNotFoundException- If the class for an object being restored cannot be found.
-
extendMBR
public boolean extendMBR(SpatialComparable responsibleMBR)
Extend the MBR of this node.- Parameters:
responsibleMBR-- Returns:
- true when the MBR changed
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-