Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractEntry
All Implemented Interfaces:
Entry, Externalizable, Serializable
Direct Known Subclasses:
MTreeDirectoryEntry, MTreeLeafEntry, SpatialDirectoryEntry, SpatialLeafEntry

public abstract class AbstractEntry
extends Object
implements Entry

Abstract superclass for entries in an tree based index structure.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
private  Integer id
          Holds the id of the object (node or data object) represented by this entry.
 
Constructor Summary
  AbstractEntry()
          Empty constructor for serialization purposes.
protected AbstractEntry(Integer 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.
 Integer getID()
          Returns the id of the node or data object that is represented by this entry.
 int hashCode()
          Returns as hash code for the entry its id.
 void readExternal(ObjectInput in)
          Restores the id of the object (node or data object) that is represented by this entry from the specified stream.
 void setID(Integer id)
          Sets the id of the node or data object that is represented by this entry.
 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
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Entry
isLeafEntry
 

Field Detail

id

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

Constructor Detail

AbstractEntry

public AbstractEntry()
Empty constructor for serialization purposes.


AbstractEntry

protected AbstractEntry(Integer 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

getID

public final Integer getID()
Returns the id of the node or data object that is represented by this entry.

Specified by:
getID in interface Entry
Returns:
the id of the node or data object that is represented by this entry

setID

public final void setID(Integer id)
Sets the id of the node or data object that is represented by this entry.

Specified by:
setID in interface Entry
Parameters:
id - the id to be set

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.3 (2010-03-31_1612)