Interface PageFile<P extends Page>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Clears this PageFile.
      void close()
      Closes this file.
      void deletePage​(int pageID)
      Deletes the node with the specified id from this file.
      int getNextPageID()
      Returns the next page id.
      int getPageSize()
      Get the page size of this page file.
      boolean initialize​(PageHeader header)
      Initialize the page file with the given header - return "true" if the file already existed.
      void logStatistics()
      Log some statistics to the appropriate logger.
      P readPage​(int pageID)
      Reads the page with the given id from this file.
      void setNextPageID​(int nextPageID)
      Sets the next page id.
      int setPageID​(P page)
      Sets the id of the given page.
      int writePage​(P page)
      Writes a page into this file.
    • Method Detail

      • setPageID

        int setPageID​(P page)
        Sets the id of the given page.
        Parameters:
        page - the page to set the id
        Returns:
        the page id
      • writePage

        int writePage​(P page)
        Writes a page into this file. The method tests if the page has already an id, otherwise a new id is assigned and returned.
        Parameters:
        page - the page to be written
        Returns:
        the id of the page
      • readPage

        P readPage​(int pageID)
        Reads the page with the given id from this file.
        Parameters:
        pageID - the id of the page to be returned
        Returns:
        the page with the given pageId
      • deletePage

        void deletePage​(int pageID)
        Deletes the node with the specified id from this file.
        Parameters:
        pageID - the id of the node to be deleted
      • close

        void close()
        Closes this file.
      • clear

        void clear()
        Clears this PageFile.
      • getNextPageID

        int getNextPageID()
        Returns the next page id.
        Returns:
        the next page id
      • setNextPageID

        void setNextPageID​(int nextPageID)
        Sets the next page id.
        Parameters:
        nextPageID - the next page id to be set
      • getPageSize

        int getPageSize()
        Get the page size of this page file.
        Returns:
        page size
      • initialize

        boolean initialize​(PageHeader header)
        Initialize the page file with the given header - return "true" if the file already existed.
        Parameters:
        header - Header
        Returns:
        true when the file already existed.
      • logStatistics

        void logStatistics()
        Log some statistics to the appropriate logger.