Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants
Class MTreeLeafEntry<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.MTreeLeafEntry<D>
Type Parameters:
D - the type of Distance used in the M-Tree
All Implemented Interfaces:
Entry, MetricalEntry, MTreeEntry<D>, Externalizable, Serializable
Direct Known Subclasses:
MkAppLeafEntry, MkCoPLeafEntry, MkMaxLeafEntry, MkTabLeafEntry

public class MTreeLeafEntry<D extends Distance<D>>
extends AbstractEntry
implements MTreeEntry<D>

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.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
private  D parentDistance
          The distance from the underlying data object to its parent's routing object.
private static long serialVersionUID
           
 
Constructor Summary
MTreeLeafEntry()
          Empty constructor for serialization purposes.
MTreeLeafEntry(Integer objectID, D parentDistance)
          Provides a new MTreeLeafEntry object with the given parameters.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 D getCoveringRadius()
          Returns null, since a leaf entry has no covering radius.
 D getParentDistance()
          Returns the distance from the underlying data object to its parent's routing object.
 Integer getRoutingObjectID()
          Returns the id of the underlying data object of this entry.
 boolean isLeafEntry()
          Returns true, since this entry is a leaf entry.
 void readExternal(ObjectInput in)
          Calls the super method and reads the parentDistance of this entry from the specified input stream.
 void setCoveringRadius(D coveringRadius)
          Throws an UnsupportedOperationException, since a leaf entry has no covering radius.
 void setParentDistance(D parentDistance)
          Sets the distance from the underlying data object to its parent's routing object.
 void setRoutingObjectID(Integer objectID)
          Sets the id of the underlying data object of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the parentDistance of this entry to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractEntry
getID, hashCode, setID, toString
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

parentDistance

private D extends Distance<D> 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(Integer objectID,
                      D parentDistance)
Provides a new MTreeLeafEntry object with the given parameters.

Parameters:
objectID - the id of the underlying data object
parentDistance - the distance from the underlying data object to its parent's routing object
Method Detail

getRoutingObjectID

public final Integer getRoutingObjectID()
Returns the id of the underlying data object of this entry.

Specified by:
getRoutingObjectID in interface MTreeEntry<D extends Distance<D>>
Returns:
the id of the underlying data object of this entry

setRoutingObjectID

public final void setRoutingObjectID(Integer objectID)
Sets the id of the underlying data 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 underlying data object to its parent's routing object.

Specified by:
getParentDistance in interface MTreeEntry<D extends Distance<D>>
Returns:
the distance from the underlying data object to its parent's routing object

setParentDistance

public final void setParentDistance(D parentDistance)
Sets the distance from the underlying data object to its parent's routing object.

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

getCoveringRadius

public D getCoveringRadius()
Returns null, since a leaf entry has no covering radius.

Specified by:
getCoveringRadius in interface MTreeEntry<D extends Distance<D>>
Returns:
null

setCoveringRadius

public void setCoveringRadius(D coveringRadius)
Throws an UnsupportedOperationException, since a leaf entry has no covering radius.

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

isLeafEntry

public final boolean isLeafEntry()
Returns true, since this entry is a leaf entry.

Specified by:
isLeafEntry in interface Entry
Returns:
true

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Calls the super method and writes the parentDistance of this entry to the specified stream.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractEntry
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Calls the super method and reads the parentDistance of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractEntry
Throws:
ClassNotFoundException - If the class for an object being restored cannot be found.
IOException

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 MTreeLeafEntry and has the same parentDistance as this entry.

Release 0.2 (2009-07-06_1820)