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.AbstractLeafEntry
      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, LeafEntry, MTreeEntry<D>, Externalizable, Serializable
Direct Known Subclasses:
MkAppLeafEntry, MkCoPLeafEntry, MkMaxLeafEntry, MkTabLeafEntry

public class MTreeLeafEntry<D extends Distance<D>>
extends AbstractLeafEntry
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.

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(DBID 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.
 DBID getRoutingObjectID()
          Returns the id of the underlying data object of this 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(DBID objectID)
          todo ok
 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.AbstractLeafEntry
getDBID, hashCode, isLeafEntry, 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
isLeafEntry
 

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(DBID 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 DBID 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(DBID objectID)
todo ok

Specified by:
setRoutingObjectID in interface MTreeEntry<D extends Distance<D>>
Parameters:
objectID - the id to be set
Throws:
UnsupportedOperationException - since leaf entries should not be assigned a routing object.

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 - thrown since a leaf has no covering radius

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 AbstractLeafEntry
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 AbstractLeafEntry
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 AbstractLeafEntry
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.4.0 (2011-09-20_1324)