Class AbstractRStarTreeNode<N extends AbstractRStarTreeNode<N,​E>,​E extends SpatialEntry>

  • Type Parameters:
    N - Node type
    E - Entry type
    All Implemented Interfaces:
    elki.index.tree.Node<E>, elki.persistent.Page, java.io.Externalizable, java.io.Serializable
    Direct Known Subclasses:
    DeLiCluNode, FlatRStarTreeNode, RdKNNNode, RStarTreeNode

    public abstract class AbstractRStarTreeNode<N extends AbstractRStarTreeNode<N,​E>,​E extends SpatialEntry>
    extends elki.index.tree.AbstractNode<E>
    implements elki.index.tree.Node<E>
    Abstract superclass for nodes in a R*-Tree.
    Since:
    0.1
    Author:
    Elke Achtert
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class elki.index.tree.AbstractNode

        entries, isLeaf, numEntries
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractRStarTreeNode()
      Empty constructor for Externalizable interface.
      AbstractRStarTreeNode​(int capacity, boolean isLeaf)
      Creates a new AbstractRStarTreeNode with the specified parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean adjustEntry​(E entry)
      Adjusts the parameters of the entry representing this node.
      boolean adjustEntryIncremental​(E entry, elki.data.spatial.SpatialComparable responsibleMBR)
      Adjusts the parameters of the entry representing this node.
      elki.data.ModifiableHyperBoundingBox computeMBR()
      Recomputing the MBR is rather expensive.
      int integrityCheck​(AbstractRStarTree<N,​E,​?> tree)
      Tests this node (public for debugging purposes).
      protected void integrityCheckParameters​(N parent, int index)
      Tests, if the parameters of the entry representing this node, are correctly set.
      void readExternal​(java.io.ObjectInput in)
      Reads the id of this node, the numEntries and the entries array from the specified stream.
      void writeExternal​(java.io.ObjectOutput out)
      Calls the super method and writes the id of this node, the numEntries and the entries array to the specified stream.
      • Methods inherited from class elki.index.tree.AbstractNode

        addEntry, children, deleteAllEntries, deleteEntry, getCapacity, getEntry, getNumEntries, isLeaf, removeMask, splitByMask, splitTo, splitTo, toString
      • Methods inherited from class elki.persistent.AbstractExternalizablePage

        equals, getPageID, hashCode, isDirty, setDirty, setPageID
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface elki.index.tree.Node

        addEntry, children, getEntry, getNumEntries, isLeaf
      • Methods inherited from interface elki.persistent.Page

        getPageID, isDirty, setDirty, setPageID
    • Constructor Detail

      • AbstractRStarTreeNode

        public AbstractRStarTreeNode()
        Empty constructor for Externalizable interface.
      • AbstractRStarTreeNode

        public AbstractRStarTreeNode​(int capacity,
                                     boolean isLeaf)
        Creates a new AbstractRStarTreeNode with the specified parameters.
        Parameters:
        capacity - the capacity (maximum number of entries plus 1 for overflow) of this node
        isLeaf - indicates whether this node is a leaf node
    • Method Detail

      • computeMBR

        public elki.data.ModifiableHyperBoundingBox computeMBR()
        Recomputing the MBR is rather expensive.
        Returns:
        MBR
      • adjustEntry

        public boolean adjustEntry​(E entry)
        Adjusts the parameters of the entry representing this node.
        Parameters:
        entry - the entry representing this node
      • adjustEntryIncremental

        public boolean adjustEntryIncremental​(E entry,
                                              elki.data.spatial.SpatialComparable responsibleMBR)
        Adjusts the parameters of the entry representing this node. Only applicable if one object was inserted or the size of an existing node increased.
        Parameters:
        entry - the entry representing this node
        responsibleMBR - the MBR of the object or node which is responsible for the call of the method
        Returns:
        true when the entry has changed
      • integrityCheck

        public final int integrityCheck​(AbstractRStarTree<N,​E,​?> tree)
        Tests this node (public for debugging purposes).
        Parameters:
        tree - Tree context
        Returns:
        levels below
      • integrityCheckParameters

        protected void integrityCheckParameters​(N parent,
                                                int index)
        Tests, if the parameters of the entry representing this node, are correctly set. Subclasses may need to overwrite this method.
        Parameters:
        parent - the parent holding the entry representing this node
        index - the index of the entry in the parents child array
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Calls the super method and writes the id of this node, the numEntries and the entries array to the specified stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class elki.index.tree.AbstractNode<E extends SpatialEntry>
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Reads the id of this node, the numEntries and the entries array from the specified stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class elki.index.tree.AbstractNode<E extends SpatialEntry>
        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.