Package elki.index.tree.spatial
Class SpatialDirectoryEntry
- java.lang.Object
-
- elki.index.tree.spatial.SpatialDirectoryEntry
-
- All Implemented Interfaces:
elki.data.spatial.SpatialComparable,elki.index.tree.DirectoryEntry,SpatialEntry,java.io.Externalizable,java.io.Serializable
- Direct Known Subclasses:
DeLiCluDirectoryEntry,RdKNNDirectoryEntry
public class SpatialDirectoryEntry extends java.lang.Object implements elki.index.tree.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 elki.data.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, elki.data.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(elki.data.spatial.SpatialComparable responsibleMBR)Extend the MBR of this node.intgetDimensionality()doublegetMax(int dimension)doublegetMin(int dimension)intgetPageID()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(elki.data.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 elki.data.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, elki.data.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()
- Specified by:
getPageIDin interfaceelki.index.tree.DirectoryEntry
-
getDimensionality
public int getDimensionality()
- Specified by:
getDimensionalityin interfaceelki.data.spatial.SpatialComparable
-
getMin
public double getMin(int dimension)
- Specified by:
getMinin interfaceelki.data.spatial.SpatialComparable- 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)
- Specified by:
getMaxin interfaceelki.data.spatial.SpatialComparable- 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(elki.data.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(elki.data.spatial.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
-
-