Class MTreeLeafEntry

  • All Implemented Interfaces:
    LeafEntry, MTreeEntry, java.io.Externalizable, java.io.Serializable
    Direct Known Subclasses:
    MkAppLeafEntry, MkCoPLeafEntry, MkMaxLeafEntry, MkTabLeafEntry

    public class MTreeLeafEntry
    extends java.lang.Object
    implements LeafEntry, MTreeEntry
    Represents an entry in a leaf node of an M-Tree. A MTreeLeafEntry consists of an id (representing the unique id of the underlying object in the database) and the distance from the data object to its parent routing object in the M-Tree.
    Since:
    0.1
    Author:
    Elke Achtert
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private DBID id
      Holds the id of the object (node or data object) represented by this entry.
      private double parentDistance
      The distance from the underlying data object to its parent's routing object.
      private static long serialVersionUID
      Serialization version ID.
    • Constructor Summary

      Constructors 
      Constructor Description
      MTreeLeafEntry()
      Empty constructor for serialization purposes.
      MTreeLeafEntry​(DBID objectID, double parentDistance)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      double getCoveringRadius()
      Returns zero, since a leaf entry has no covering radius.
      DBID getDBID()
      Get the DBID of this leaf entry.
      double getParentDistance()
      Returns the distance from the underlying data object to its parent's routing object.
      DBID getRoutingObjectID()
      Returns the id of the underlying data object of this entry.
      int hashCode()  
      void readExternal​(java.io.ObjectInput in)  
      boolean setCoveringRadius​(double coveringRadius)
      Throws an UnsupportedOperationException, since a leaf entry has no covering radius.
      boolean setParentDistance​(double parentDistance)
      Sets the distance from the underlying data object to its parent's routing object.
      boolean setRoutingObjectID​(DBID objectID)
      Throws an UnsupportedOperationException, as leaves may not have routing objects.
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Serialization version ID.
        See Also:
        Constant Field Values
      • id

        private DBID id
        Holds the id of the object (node or data object) represented by this entry.
      • parentDistance

        private double parentDistance
        The distance from the underlying data object to its parent's routing object.
    • Constructor Detail

      • MTreeLeafEntry

        public MTreeLeafEntry()
        Empty constructor for serialization purposes.
      • MTreeLeafEntry

        public MTreeLeafEntry​(DBID objectID,
                              double parentDistance)
        Constructor.
        Parameters:
        objectID - the id of the underlying data object
        parentDistance - the distance from the underlying data object to its parent's routing object
    • Method Detail

      • getDBID

        public DBID getDBID()
        Description copied from interface: LeafEntry
        Get the DBID of this leaf entry.
        Specified by:
        getDBID in interface LeafEntry
      • getRoutingObjectID

        public final DBID getRoutingObjectID()
        Returns the id of the underlying data object of this entry.
        Specified by:
        getRoutingObjectID in interface MTreeEntry
        Returns:
        the id of the underlying data object of this entry
      • setRoutingObjectID

        public final boolean setRoutingObjectID​(DBID objectID)
        Throws an UnsupportedOperationException, as leaves may not have routing objects.
        Specified by:
        setRoutingObjectID in interface MTreeEntry
        Parameters:
        objectID - the id to be set
        Returns:
        TODO
        Throws:
        java.lang.UnsupportedOperationException - since leaf entries should not be assigned a routing object.
      • getParentDistance

        public final double getParentDistance()
        Returns the distance from the underlying data object to its parent's routing object.
        Specified by:
        getParentDistance in interface MTreeEntry
        Returns:
        the distance from the underlying data object to its parent's routing object
      • setParentDistance

        public final boolean setParentDistance​(double parentDistance)
        Sets the distance from the underlying data object to its parent's routing object.
        Specified by:
        setParentDistance in interface MTreeEntry
        Parameters:
        parentDistance - the distance to be set
        Returns:
        TODO
      • getCoveringRadius

        public double getCoveringRadius()
        Returns zero, since a leaf entry has no covering radius.
        Specified by:
        getCoveringRadius in interface MTreeEntry
        Returns:
        Zero
      • setCoveringRadius

        public boolean setCoveringRadius​(double coveringRadius)
        Throws an UnsupportedOperationException, since a leaf entry has no covering radius.
        Specified by:
        setCoveringRadius in interface MTreeEntry
        Parameters:
        coveringRadius - the covering radius to be set
        Returns:
        TODO
        Throws:
        java.lang.UnsupportedOperationException - thrown since a leaf has no covering radius
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • 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