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 double
coveringRadius
The covering radius of the entry.private int
id
Holds the id of the object (node or data object) represented by this entry.private double
parentDistance
The distance from the routing object of this entry to its parent's routing object.private DBID
routingObjectID
The id of routing object of this entry.private static long
serialVersionUID
Serialization 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 boolean
equals(java.lang.Object o)
double
getCoveringRadius()
Returns the covering radius of this entry.int
getPageID()
Get the page ID of this directory entry.double
getParentDistance()
Returns the distance from the routing object of this entry to its parent's routing object.DBID
getRoutingObjectID()
Returns the id of the routing object of this entry.int
hashCode()
void
readExternal(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.boolean
setCoveringRadius(double coveringRadius)
Sets the covering radius of this entry.boolean
setParentDistance(double parentDistance)
Sets the distance from the object to its parent object.boolean
setRoutingObjectID(DBID objectID)
Sets the id of the routing object of this entry.java.lang.String
toString()
void
writeExternal(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:DirectoryEntry
Get the page ID of this directory entry.- Specified by:
getPageID
in interfaceDirectoryEntry
-
getCoveringRadius
public final double getCoveringRadius()
Returns the covering radius of this entry.- Specified by:
getCoveringRadius
in interfaceMTreeEntry
- Returns:
- the covering radius of this entry
-
setCoveringRadius
public final boolean setCoveringRadius(double coveringRadius)
Sets the covering radius of this entry.- Specified by:
setCoveringRadius
in 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:
getRoutingObjectID
in 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:
setRoutingObjectID
in 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:
getParentDistance
in 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:
setParentDistance
in interfaceMTreeEntry
- Parameters:
parentDistance
- the distance to be set- Returns:
- TODO
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Calls the super method and writes the routingObjectID, the parentDistance and the coveringRadius of this entry to the specified stream.- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Calls the super method and reads the routingObjectID, the parentDistance and the coveringRadius of this entry from the specified input stream.- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-