Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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.AbstractEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeDirectoryEntry<D>
All Implemented Interfaces:
Entry, MetricalEntry, MTreeEntry<D>, Externalizable, Serializable
Direct Known Subclasses:
MkAppDirectoryEntry, MkCoPDirectoryEntry, MkMaxDirectoryEntry, MkTabDirectoryEntry

public class MTreeDirectoryEntry<D extends Distance<D>>
extends AbstractEntry
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.

Author:
Elke Achtert
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  Integer routingObjectID
          The id of routing object of this entry.
 
Constructor Summary
MTreeDirectoryEntry()
          Empty constructor for serialization purposes.
MTreeDirectoryEntry(Integer 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.
 Integer getRoutingObjectID()
          Returns the id of the routing object of this entry.
 boolean isLeafEntry()
          Returns false.
 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(Integer 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.AbstractEntry
getID, hashCode, setID
 
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
getID, setID
 

Field Detail

routingObjectID

private Integer 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(Integer 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 Integer 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(Integer 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

isLeafEntry

public final boolean isLeafEntry()
Returns false.

Specified by:
isLeafEntry in interface Entry
Returns:
false

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 AbstractEntry
Parameters:
out - the stream to write the object to
Throws:
IOException - Includes any I/O exceptions that may occur

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 AbstractEntry
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being restored cannot be found.

toString

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

Overrides:
toString in class AbstractEntry
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 AbstractEntry
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.1 (2008-07-10_1838)