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>
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.
 
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.
 D getParentDistance()
          Returns the distance from the underlying data object to its parent's routing object.
 Integer getRoutingObjectID()
          Returns the id of the underlying database object of this entry.
 boolean isLeafEntry()
          Returns true if this entry is a leaf entry, false otherwise.
 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.
 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 database 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

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 database object of this entry.

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

setRoutingObjectID

public final void setRoutingObjectID(Integer objectID)
Sets the id of the underlying database 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.

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

setCoveringRadius

public void setCoveringRadius(D coveringRadius)
Throws an UnsupportedOperationException.

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 if this entry is a leaf entry, false otherwise.

Specified by:
isLeafEntry in interface Entry
Returns:
true if this entry is a leaf entry, false otherwise

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
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 parentDistance 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.

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.1 (2008-07-10_1838)