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

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

public abstract class AbstractDirectoryEntry
extends Object
implements DirectoryEntry

Abstract superclass for entries in an tree based index structure.

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
  AbstractDirectoryEntry()
          Empty constructor for serialization purposes.
protected AbstractDirectoryEntry(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 getEntryID()
          Returns the id of the node or data object that is represented by this entry.
 Integer getPageID()
          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.
 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 Integer id
Holds the id of the object (node or data object) represented by this entry.

Constructor Detail

AbstractDirectoryEntry

public AbstractDirectoryEntry()
Empty constructor for serialization purposes.


AbstractDirectoryEntry

protected AbstractDirectoryEntry(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

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

getPageID

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

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

getEntryID

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

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

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)