Class MTreeLeafEntry
- java.lang.Object
-
- elki.index.tree.metrical.mtreevariants.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 DBIDidHolds the id of the object (node or data object) represented by this entry.private doubleparentDistanceThe distance from the underlying data object to its parent's routing object.private static longserialVersionUIDSerialization 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 booleanequals(java.lang.Object o)doublegetCoveringRadius()Returns zero, since a leaf entry has no covering radius.DBIDgetDBID()Get the DBID of this leaf entry.doublegetParentDistance()Returns the distance from the underlying data object to its parent's routing object.DBIDgetRoutingObjectID()Returns the id of the underlying data object of this entry.inthashCode()voidreadExternal(java.io.ObjectInput in)booleansetCoveringRadius(double coveringRadius)Throws an UnsupportedOperationException, since a leaf entry has no covering radius.booleansetParentDistance(double parentDistance)Sets the distance from the underlying data object to its parent's routing object.booleansetRoutingObjectID(DBID objectID)Throws an UnsupportedOperationException, as leaves may not have routing objects.voidwriteExternal(java.io.ObjectOutput out)
-
-
-
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 objectparentDistance- the distance from the underlying data object to its parent's routing object
-
-
Method Detail
-
getDBID
public DBID getDBID()
Description copied from interface:LeafEntryGet the DBID of this leaf entry.
-
getRoutingObjectID
public final DBID getRoutingObjectID()
Returns the id of the underlying data object of this entry.- Specified by:
getRoutingObjectIDin interfaceMTreeEntry- 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:
setRoutingObjectIDin interfaceMTreeEntry- 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:
getParentDistancein interfaceMTreeEntry- 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:
setParentDistancein interfaceMTreeEntry- 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:
getCoveringRadiusin interfaceMTreeEntry- Returns:
- Zero
-
setCoveringRadius
public boolean setCoveringRadius(double coveringRadius)
Throws an UnsupportedOperationException, since a leaf entry has no covering radius.- Specified by:
setCoveringRadiusin interfaceMTreeEntry- 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:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-