de.lmu.ifi.dbs.elki.persistent
Class AbstractPage

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.persistent.AbstractPage
All Implemented Interfaces:
Page, Externalizable, Serializable
Direct Known Subclasses:
AbstractNode

public abstract class AbstractPage
extends Object
implements Page

Abstract superclass for pages.

See Also:
Serialized Form

Field Summary
private  boolean dirty
          The dirty flag of this page.
private  Integer id
          The unique id if this page.
private static long serialVersionUID
          Serial version
 
Constructor Summary
AbstractPage()
          Empty constructor for Externalizable interface.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 Integer getPageID()
          Returns the unique id of this Page.
 int hashCode()
          Returns as hash code value for this node the id of this node.
 boolean isDirty()
          Returns true if this page is dirty, false otherwise.
 void readExternal(ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
 void setDirty(boolean dirty)
          Sets the dirty flag of this page.
 void setPageID(int id)
          Sets the unique id of this Page.
 String toString()
          Returns a string representation of the object.
 void writeExternal(ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version

See Also:
Constant Field Values

id

private Integer id
The unique id if this page.


dirty

private boolean dirty
The dirty flag of this page.

Constructor Detail

AbstractPage

public AbstractPage()
Empty constructor for Externalizable interface.

Method Detail

getPageID

public final Integer getPageID()
Returns the unique id of this Page.

Specified by:
getPageID in interface Page
Returns:
the unique id of this Page

setPageID

public final void setPageID(int id)
Sets the unique id of this Page.

Specified by:
setPageID in interface Page
Parameters:
id - the id to be set

isDirty

public final boolean isDirty()
Returns true if this page is dirty, false otherwise.

Specified by:
isDirty in interface Page
Returns:
true if this page is dirty, false otherwise

setDirty

public final void setDirty(boolean dirty)
Sets the dirty flag of this page.

Specified by:
setDirty in interface Page
Parameters:
dirty - the dirty flag to be set

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface Externalizable
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
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface Externalizable
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.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object

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 AbstractNode and has the same id and the same entries as this node.

hashCode

public int hashCode()
Returns as hash code value for this node the id of this node.

Overrides:
hashCode in class Object
Returns:
the id of this node

Release 0.4.0 (2011-09-20_1324)