org.crosswire.jsword.book.sword.state

## Class GenBookBackendState

- java.lang.Object
- - org.crosswire.jsword.book.sword.state.AbstractOpenFileState
  - - org.crosswire.jsword.book.sword.state.GenBookBackendState

- All Implemented Interfaces:
    Closeable, AutoCloseable, OpenFileState

      public class GenBookBackendState
      extends AbstractOpenFileState

  Stores the random access files required for processing the passage request The caller is required to close to correctly free resources and avoid File pointer leaks
  Author:
    DM Smith
  See Also:
    `The GNU Lesser General Public License for details.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private File` | `bdtFile` The raw data file
    `private RandomAccessFile` | `bdtRaf` The random access file for the raw data
    `private static String` | `EXTENSION_BDT` Raw GenBook file extensions
    `private static org.slf4j.Logger` | `LOGGER` The log stream

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenBookBackendState(BookMetaData bookMetaData)` This is default package access for forcing the use of the OpenFileStateManager to manage the creation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RandomAccessFile` | `getBdtRaf()`
    `void` | `releaseResources()`

    - ### Methods inherited from class org.crosswire.jsword.book.sword.state.AbstractOpenFileState

      `close, getBookMetaData, getLastAccess, setLastAccess`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EXTENSION_BDT

          private static final String EXTENSION_BDT

      Raw GenBook file extensions
      See Also:
        Constant Field Values

    - #### bdtFile

          private File bdtFile

      The raw data file

    - #### bdtRaf

          private RandomAccessFile bdtRaf

      The random access file for the raw data

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      The log stream

  - ### Constructor Detail

    - #### GenBookBackendState

          GenBookBackendState(BookMetaData bookMetaData)

      This is default package access for forcing the use of the OpenFileStateManager to manage the creation. Not doing so may result in new instances of OpenFileState being created for no reason, and as a result, if they are released to the OpenFileStateManager by mistake this would result in leakage
      Parameters:
        `bookMetaData` - the appropriate metadata for the book

  - ### Method Detail

    - #### releaseResources

          public void releaseResources()

    - #### getBdtRaf

          public RandomAccessFile getBdtRaf()

      Returns:
        the bdtRaf