org.crosswire.jsword.book.sword.state

## Class RawLDBackendState

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, OpenFileState
  Direct Known Subclasses:
    ZLDBackendState

      public class RawLDBackendState
      extends AbstractOpenFileState

  State for `RawLDBackend`
  Author:
    DM Smith
  See Also:
    `The GNU Lesser General Public License for details.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private File` | `datFile` The data file
    `private RandomAccessFile` | `datRaf` The data random access file
    `private File` | `idxFile` The index file
    `private RandomAccessFile` | `idxRaf` The index random access file
    `private static org.slf4j.Logger` | `LOGGER` The log stream
    `private int` | `size` The number of entries in the book.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RawLDBackendState(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` | `getDatRaf()`
    `File` | `getIdxFile()`
    `RandomAccessFile` | `getIdxRaf()`
    `int` | `getSize()`
    `void` | `releaseResources()`
    `void` | `setSize(int size)`

    - ### 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

    - #### size

          private int size

      The number of entries in the book.

    - #### idxFile

          private File idxFile

      The index file

    - #### idxRaf

          private RandomAccessFile idxRaf

      The index random access file

    - #### datFile

          private File datFile

      The data file

    - #### datRaf

          private RandomAccessFile datRaf

      The data random access file

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      The log stream

  - ### Constructor Detail

    - #### RawLDBackendState

          RawLDBackendState(BookMetaData bookMetaData)
                      throws BookException

      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
      Throws:
        `BookException`

  - ### Method Detail

    - #### releaseResources

          public void releaseResources()

    - #### getSize

          public int getSize()

      Returns:
        the size

    - #### getIdxFile

          public File getIdxFile()

      Returns:
        the idxFile

    - #### getIdxRaf

          public RandomAccessFile getIdxRaf()

      Returns:
        the idxRaf

    - #### getDatRaf

          public RandomAccessFile getDatRaf()

      Returns:
        the datRaf

    - #### setSize

          public void setSize(int size)

      Parameters:
        `size` - the size to set