Package elki.persistent
Class AbstractExternalizablePage
- java.lang.Object
-
- elki.persistent.AbstractExternalizablePage
-
- All Implemented Interfaces:
Page,java.io.Externalizable,java.io.Serializable
- Direct Known Subclasses:
AbstractNode
public abstract class AbstractExternalizablePage extends java.lang.Object implements java.io.Externalizable, Page
Abstract superclass for pages.- Since:
- 0.1
- Author:
- Elke Achtert
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleandirtyThe dirty flag of this page.private intidThe unique id if this page.private static longserialVersionUIDSerial version
-
Constructor Summary
Constructors Constructor Description AbstractExternalizablePage()Empty constructor for Externalizable interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Indicates whether some other object is "equal to" this one.intgetPageID()Returns the unique id of this Page.inthashCode()Returns as hash code value for this node the id of this node.booleanisDirty()Returns true if this page is dirty, false otherwise.voidreadExternal(java.io.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.voidsetDirty(boolean dirty)Sets the dirty flag of this page.voidsetPageID(int id)Sets the unique id of this Page.java.lang.StringtoString()Returns a string representation of the object.voidwriteExternal(java.io.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.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serial version- See Also:
- Constant Field Values
-
id
private int id
The unique id if this page.
-
dirty
private transient boolean dirty
The dirty flag of this page.
-
-
Method Detail
-
getPageID
public final int getPageID()
Returns the unique id of this Page.
-
setPageID
public final void setPageID(int id)
Sets the unique id of this Page.
-
isDirty
public final boolean isDirty()
Returns true if this page is dirty, false otherwise.
-
setDirty
public final void setDirty(boolean dirty)
Sets the dirty flag of this page.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionThe 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:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- the stream to write the object to- Throws:
java.io.IOException- Includes any I/O exceptions that may occur
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionThe 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:
readExternalin interfacejava.io.Externalizable- Parameters:
in- the stream to read data from in order to restore the object- Throws:
java.io.IOException- if I/O errors occurjava.lang.ClassNotFoundException- If the class for an object being restored cannot be found.
-
toString
public java.lang.String toString()
Returns a string representation of the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object
-
equals
public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.- Overrides:
equalsin classjava.lang.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:
hashCodein classjava.lang.Object- Returns:
- the id of this node
-
-