Class 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 int id
      Holds the id of the object (node or data object) represented by this entry.
      private elki.data.ModifiableHyperBoundingBox mbr
      The minimum bounding rectangle of the underlying spatial node.
      private static long serialVersionUID
      Serialization 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
      boolean equals​(java.lang.Object o)  
      boolean extendMBR​(elki.data.spatial.SpatialComparable responsibleMBR)
      Extend the MBR of this node.
      int getDimensionality()  
      double getMax​(int dimension)  
      double getMin​(int dimension)  
      int getPageID()  
      int hashCode()  
      boolean hasMBR()
      Test whether this entry already has an MBR.
      void readExternal​(java.io.ObjectInput in)
      Calls the super method and reads the MBR object of this entry from the specified input stream.
      void setMBR​(elki.data.ModifiableHyperBoundingBox mbr)
      Sets the MBR of this entry.
      java.lang.String toString()  
      void writeExternal​(java.io.ObjectOutput out)
      Calls the super method and writes the MBR object of this entry to the specified output stream.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 node
        mbr - the minimum bounding rectangle of the underlying spatial node
    • Method Detail

      • getPageID

        public int getPageID()
        Specified by:
        getPageID in interface elki.index.tree.DirectoryEntry
      • getDimensionality

        public int getDimensionality()
        Specified by:
        getDimensionality in interface elki.data.spatial.SpatialComparable
      • getMin

        public double getMin​(int dimension)
        Specified by:
        getMin in interface elki.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:
        getMax in interface elki.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.IOException
        Calls the super method and writes the MBR object of this entry to the specified output stream.
        Specified by:
        writeExternal in interface java.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.ClassNotFoundException
        Calls the super method and reads the MBR object of this entry from the specified input stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - the stream to read data from in order to restore the object
        Throws:
        java.io.IOException - if I/O errors occur
        java.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:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object