de.lmu.ifi.dbs.elki.index.tree
Class AbstractLeafEntry

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
All Implemented Interfaces:
Entry, LeafEntry, Externalizable, Serializable
Direct Known Subclasses:
MTreeLeafEntry, SpatialPointLeafEntry

public abstract class AbstractLeafEntry
extends Object
implements LeafEntry

Abstract superclass for entries in an tree based index structure.

See Also:
Serialized Form

Field Summary
private  DBID id
          Holds the id of the object (node or data object) represented by this entry.
 
Constructor Summary
  AbstractLeafEntry()
          Empty constructor for serialization purposes.
protected AbstractLeafEntry(DBID id)
          Provides a new AbstractEntry with the specified id.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 DBID getDBID()
          Get the DBID of this leaf entry.
 int hashCode()
          Returns as hash code for the entry its id.
 boolean isLeafEntry()
          Returns true if this entry is an entry in a leaf node (i.e. this entry represents a data object), false otherwise.
 void readExternal(ObjectInput in)
          Restores the id of the object (node or data object) that is represented by this entry from the specified stream.
 String toString()
          Returns the id as a string representation of this entry.
 void writeExternal(ObjectOutput out)
          Writes the id of the object (node or data object) that is represented by this entry to the specified stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private DBID id
Holds the id of the object (node or data object) represented by this entry.

Constructor Detail

AbstractLeafEntry

public AbstractLeafEntry()
Empty constructor for serialization purposes.


AbstractLeafEntry

protected AbstractLeafEntry(DBID id)
Provides a new AbstractEntry with the specified id.

Parameters:
id - the id of the object (node or data object) represented by this entry.
Method Detail

isLeafEntry

public final boolean isLeafEntry()
Description copied from interface: Entry
Returns true if this entry is an entry in a leaf node (i.e. this entry represents a data object), false otherwise.

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

getDBID

public DBID getDBID()
Description copied from interface: LeafEntry
Get the DBID of this leaf entry.

Specified by:
getDBID in interface LeafEntry

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Writes the id of the object (node or data object) that is represented by this entry to the specified stream.

Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Restores the id of the object (node or data object) that is represented by this entry from the specified stream.

Specified by:
readExternal in interface Externalizable
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 Object
Parameters:
o - the object to be tested
Returns:
true, if o is an AbstractEntry and has the same id as this entry.

hashCode

public int hashCode()
Returns as hash code for the entry its id.

Overrides:
hashCode in class Object
Returns:
the id of the entry

toString

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

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

Release 0.4.0 (2011-09-20_1324)