org.crosswire.jsword.book.sword.state
Class RawBackendState

java.lang.Object
  extended by org.crosswire.jsword.book.sword.state.AbstractOpenFileState
      extended by org.crosswire.jsword.book.sword.state.RawBackendState
All Implemented Interfaces:
Closeable, OpenFileState
Direct Known Subclasses:
RawFileBackendState

public class RawBackendState
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:
for license details.
The copyright to this program is held by it's authors.

Field Summary
private  SwordBookMetaData bookMetaData
           
private static org.slf4j.Logger log
          The log stream
protected  File ntIdxFile
           
protected  RandomAccessFile ntIdxRaf
           
protected  File ntTextFile
           
protected  RandomAccessFile ntTextRaf
           
protected  File otIdxFile
           
protected  RandomAccessFile otIdxRaf
           
protected  File otTextFile
           
protected  RandomAccessFile otTextRaf
           
 
Constructor Summary
RawBackendState(SwordBookMetaData bookMetaData)
          This is default package access for forcing the use of the OpenFileStateManager to manage the creation.
 
Method Summary
 SwordBookMetaData getBookMetaData()
           
 File getNtIdxFile()
           
 RandomAccessFile getNtIdxRaf()
           
 File getNtTextFile()
           
 RandomAccessFile getNtTextRaf()
           
 File getOtIdxFile()
           
 RandomAccessFile getOtIdxRaf()
           
 File getOtTextFile()
           
 RandomAccessFile getOtTextRaf()
           
 boolean isWritable()
           
 void releaseIndex()
           
 void releaseResources()
           
 
Methods inherited from class org.crosswire.jsword.book.sword.state.AbstractOpenFileState
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

otIdxRaf

protected RandomAccessFile otIdxRaf

ntIdxRaf

protected RandomAccessFile ntIdxRaf

otTextRaf

protected RandomAccessFile otTextRaf

ntTextRaf

protected RandomAccessFile ntTextRaf

ntIdxFile

protected File ntIdxFile

ntTextFile

protected File ntTextFile

otIdxFile

protected File otIdxFile

otTextFile

protected File otTextFile

bookMetaData

private SwordBookMetaData bookMetaData

log

private static final org.slf4j.Logger log
The log stream

Constructor Detail

RawBackendState

RawBackendState(SwordBookMetaData 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

releaseIndex

public void releaseIndex()

isWritable

public boolean isWritable()

releaseResources

public void releaseResources()

getOtIdxRaf

public RandomAccessFile getOtIdxRaf()
Returns:
the otIdxRaf

getNtIdxRaf

public RandomAccessFile getNtIdxRaf()
Returns:
the ntIdxRaf

getOtTextRaf

public RandomAccessFile getOtTextRaf()
Returns:
the otTextRaf

getNtTextRaf

public RandomAccessFile getNtTextRaf()
Returns:
the ntTextRaf

getNtTextFile

public File getNtTextFile()
Returns:
the ntTextFile

getOtTextFile

public File getOtTextFile()
Returns:
the otTextFile

getNtIdxFile

public File getNtIdxFile()
Returns:
the ntIdxFile

getOtIdxFile

public File getOtIdxFile()
Returns:
the otIdxFile

getBookMetaData

public SwordBookMetaData getBookMetaData()
Returns:
the bookMetaData

Copyright ? 2003-2011