Class 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 boolean dirty
      The dirty flag of this page.
      private int id
      The unique id if this page.
      private static long serialVersionUID
      Serial 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
      boolean equals​(java.lang.Object o)
      Indicates whether some other object is "equal to" this one.
      int 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​(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.
      void setDirty​(boolean dirty)
      Sets the dirty flag of this page.
      void setPageID​(int id)
      Sets the unique id of this Page.
      java.lang.String toString()
      Returns a string representation of the object.
      void writeExternal​(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.
      • 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 int id
        The unique id if this page.
      • dirty

        private transient boolean dirty
        The dirty flag of this page.
    • Constructor Detail

      • AbstractExternalizablePage

        public AbstractExternalizablePage()
        Empty constructor for Externalizable interface.
    • Method Detail

      • getPageID

        public final int 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​(java.io.ObjectOutput out)
                           throws java.io.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 java.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.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 java.io.Externalizable
        Parameters:
        in - the stream to read data from in order to restore the object
        Throws:
        java.io.IOException - if I/O errors occur
        java.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:
        toString in class java.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:
        equals in class java.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:
        hashCode in class java.lang.Object
        Returns:
        the id of this node