de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants
Class MTreeDirectoryEntry<D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractDirectoryEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeDirectoryEntry<D>
Type Parameters:
D - the type of Distance used in the M-Tree
All Implemented Interfaces:
DirectoryEntry, Entry, MTreeEntry<D>, Externalizable, Serializable
Direct Known Subclasses:
MkAppDirectoryEntry, MkCoPDirectoryEntry, MkMaxDirectoryEntry, MkTabDirectoryEntry

public class MTreeDirectoryEntry<D extends Distance<D>>
extends AbstractDirectoryEntry
implements MTreeEntry<D>

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.

See Also:
Serialized Form

Field Summary
private  D coveringRadius
          The covering radius of the entry.
private  D 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
           
 
Constructor Summary
MTreeDirectoryEntry()
          Empty constructor for serialization purposes.
MTreeDirectoryEntry(DBID objectID, D parentDistance, Integer nodeID, D coveringRadius)
          Provides a new MTreeDirectoryEntry with the given parameters.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 D getCoveringRadius()
          Returns the covering radius of this entry.
 D 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.
 void readExternal(ObjectInput in)
          Calls the super method and reads the routingObjectID, the parentDistance and the coveringRadius of this entry from the specified input stream.
 void setCoveringRadius(D coveringRadius)
          Sets the covering radius of this entry.
 void setParentDistance(D parentDistance)
          Sets the distance from the object to its parent object.
 void setRoutingObjectID(DBID objectID)
          Sets the id of the routing object of this entry.
 String toString()
          Returns the id as a string representation of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the routingObjectID, the parentDistance and the coveringRadius of this entry to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractDirectoryEntry
getEntryID, getPageID, hashCode, isLeafEntry
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Entry
isLeafEntry
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

routingObjectID

private DBID routingObjectID
The id of routing object of this entry.


parentDistance

private D extends Distance<D> parentDistance
The distance from the routing object of this entry to its parent's routing object.


coveringRadius

private D extends Distance<D> coveringRadius
The covering radius of the entry.

Constructor Detail

MTreeDirectoryEntry

public MTreeDirectoryEntry()
Empty constructor for serialization purposes.


MTreeDirectoryEntry

public MTreeDirectoryEntry(DBID objectID,
                           D parentDistance,
                           Integer nodeID,
                           D coveringRadius)
Provides a new MTreeDirectoryEntry with the given parameters.

Parameters:
objectID - the id of the routing object
parentDistance - the distance from the routing object of this entry to its parent's routing object
nodeID - the id of the underlying node
coveringRadius - the covering radius of the entry
Method Detail

getCoveringRadius

public final D getCoveringRadius()
Returns the covering radius of this entry.

Specified by:
getCoveringRadius in interface MTreeEntry<D extends Distance<D>>
Returns:
the covering radius of this entry

setCoveringRadius

public final void setCoveringRadius(D coveringRadius)
Sets the covering radius of this entry.

Specified by:
setCoveringRadius in interface MTreeEntry<D extends Distance<D>>
Parameters:
coveringRadius - the covering radius to be set

getRoutingObjectID

public final DBID getRoutingObjectID()
Returns the id of the routing object of this entry.

Specified by:
getRoutingObjectID in interface MTreeEntry<D extends Distance<D>>
Returns:
the id of the routing object

setRoutingObjectID

public final void setRoutingObjectID(DBID objectID)
Sets the id of the routing object of this entry.

Specified by:
setRoutingObjectID in interface MTreeEntry<D extends Distance<D>>
Parameters:
objectID - the id to be set

getParentDistance

public final D getParentDistance()
Returns the distance from the routing object of this entry to its parent's routing object.

Specified by:
getParentDistance in interface MTreeEntry<D extends Distance<D>>
Returns:
the distance from the routing object of this entry to its parent's routing object.

setParentDistance

public final void setParentDistance(D parentDistance)
Sets the distance from the object to its parent object.

Specified by:
setParentDistance in interface MTreeEntry<D extends Distance<D>>
Parameters:
parentDistance - the distance to be set

writeExternal

public void writeExternal(ObjectOutput out)
                   throws 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 interface Externalizable
Overrides:
writeExternal in class AbstractDirectoryEntry
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         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 interface Externalizable
Overrides:
readExternal in class AbstractDirectoryEntry
Throws:
ClassNotFoundException - If the class for an object being restored cannot be found.
IOException

toString

public String toString()
Returns the id as a string representation of this entry.

Overrides:
toString in class AbstractDirectoryEntry
Returns:
a string representation of this entry

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class AbstractDirectoryEntry
Parameters:
o - the object to be tested
Returns:
true, if the super method returns true and o is an MTreeDirectoryEntry and has the same coveringRadius, parentDistance and routingObjectID as this entry.

Release 0.4.0 (2011-09-20_1324)