Class MTreeDirectoryEntry
- java.lang.Object
-
- elki.index.tree.metrical.mtreevariants.MTreeDirectoryEntry
-
- All Implemented Interfaces:
DirectoryEntry,MTreeEntry,java.io.Externalizable,java.io.Serializable
- Direct Known Subclasses:
MkAppDirectoryEntry,MkCoPDirectoryEntry,MkMaxDirectoryEntry,MkTabDirectoryEntry
public class MTreeDirectoryEntry extends java.lang.Object implements DirectoryEntry, MTreeEntry
Represents an entry in a directory node of an M-Tree. A MTreeDirectoryEntry consists of an id (representing the unique id of the underlying node), the id of the routing object, the covering radius of the entry and the distance from the routing object of the entry to its parent's 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 doublecoveringRadiusThe covering radius of the entry.private intidHolds the id of the object (node or data object) represented by this entry.private doubleparentDistanceThe distance from the routing object of this entry to its parent's routing object.private DBIDroutingObjectIDThe id of routing object of this entry.private static longserialVersionUIDSerialization version.
-
Constructor Summary
Constructors Constructor Description MTreeDirectoryEntry()Empty constructor for serialization purposes.MTreeDirectoryEntry(DBID objectID, double parentDistance, int nodeID, double coveringRadius)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)doublegetCoveringRadius()Returns the covering radius of this entry.intgetPageID()Get the page ID of this directory entry.doublegetParentDistance()Returns the distance from the routing object of this entry to its parent's routing object.DBIDgetRoutingObjectID()Returns the id of the routing object of this entry.inthashCode()voidreadExternal(java.io.ObjectInput in)Calls the super method and reads the routingObjectID, the parentDistance and the coveringRadius of this entry from the specified input stream.booleansetCoveringRadius(double coveringRadius)Sets the covering radius of this entry.booleansetParentDistance(double parentDistance)Sets the distance from the object to its parent object.booleansetRoutingObjectID(DBID objectID)Sets the id of the routing object of this entry.java.lang.StringtoString()voidwriteExternal(java.io.ObjectOutput out)Calls the super method and writes the routingObjectID, the parentDistance and the coveringRadius of this entry to the specified 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.
-
routingObjectID
private DBID routingObjectID
The id of routing object of this entry.
-
parentDistance
private double parentDistance
The distance from the routing object of this entry to its parent's routing object.
-
coveringRadius
private double coveringRadius
The covering radius of the entry.
-
-
Constructor Detail
-
MTreeDirectoryEntry
public MTreeDirectoryEntry()
Empty constructor for serialization purposes.
-
MTreeDirectoryEntry
public MTreeDirectoryEntry(DBID objectID, double parentDistance, int nodeID, double coveringRadius)
Constructor.- Parameters:
objectID- the id of the routing objectparentDistance- the distance from the routing object of this entry to its parent's routing objectnodeID- the id of the underlying nodecoveringRadius- the covering radius of the entry
-
-
Method Detail
-
getPageID
public int getPageID()
Description copied from interface:DirectoryEntryGet the page ID of this directory entry.- Specified by:
getPageIDin interfaceDirectoryEntry
-
getCoveringRadius
public final double getCoveringRadius()
Returns the covering radius of this entry.- Specified by:
getCoveringRadiusin interfaceMTreeEntry- Returns:
- the covering radius of this entry
-
setCoveringRadius
public final boolean setCoveringRadius(double coveringRadius)
Sets the covering radius of this entry.- Specified by:
setCoveringRadiusin interfaceMTreeEntry- Parameters:
coveringRadius- the covering radius to be set- Returns:
- TODO
-
getRoutingObjectID
public final DBID getRoutingObjectID()
Returns the id of the routing object of this entry.- Specified by:
getRoutingObjectIDin interfaceMTreeEntry- Returns:
- the id of the routing object
-
setRoutingObjectID
public final boolean setRoutingObjectID(DBID objectID)
Sets the id of the routing object of this entry.- Specified by:
setRoutingObjectIDin interfaceMTreeEntry- Parameters:
objectID- the id to be set- Returns:
- TODO
-
getParentDistance
public final double getParentDistance()
Returns the distance from the routing object of this entry to its parent's routing object.- Specified by:
getParentDistancein interfaceMTreeEntry- Returns:
- the distance from the routing object of this entry to its parent's routing object.
-
setParentDistance
public final boolean setParentDistance(double parentDistance)
Sets the distance from the object to its parent object.- Specified by:
setParentDistancein interfaceMTreeEntry- Parameters:
parentDistance- the distance to be set- Returns:
- TODO
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionCalls the super method and writes the routingObjectID, the parentDistance and the coveringRadius of this entry to the specified stream.- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionCalls the super method and reads the routingObjectID, the parentDistance and the coveringRadius of this entry from the specified input stream.- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
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
-
-