org.crosswire.jsword.book.sword
Interface StatefulFileBackedBackend<T extends OpenFileState>

Type Parameters:
T - The type of the OpenFileState that this class extends.
All Known Implementing Classes:
AbstractBackend, AbstractKeyBackend, GenBookBackend, RawBackend, RawFileBackend, RawLDBackend, ZLDBackend, ZVerseBackend

public interface StatefulFileBackedBackend<T extends OpenFileState>

Indicates that there is a stateful backend

Author:
DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Method Summary
 T initState()
          Initialises the state required to read from files, specific to each different backend
 String readRawContent(T state, Key key)
           
 void setAliasKey(T state, Key alias, Key source)
          Sets alias for a comment on a verse range I.e.
 void setRawText(T state, Key key, String text)
          Set the text allotted for the given verse
 

Method Detail

initState

T initState()
                                  throws BookException
Initialises the state required to read from files, specific to each different backend

Returns:
the state that has been initialised
Throws:
BookException

readRawContent

String readRawContent(T state,
                      Key key)
                      throws BookException,
                             IOException
Parameters:
state - the state object containing all the open random access files
key - the verse that is sought
keyName - the name of the current key
Returns:
the raw text
Throws:
IOException - something went wrong when reading the verse
BookException

setRawText

void setRawText(T state,
                Key key,
                String text)
                throws BookException,
                       IOException
Set the text allotted for the given verse

Parameters:
state - TODO
key - The key to set text to
text - The text to be set for key
Throws:
BookException - If the data can not be set.
IOException - If the module data path could not be created.

setAliasKey

void setAliasKey(T state,
                 Key alias,
                 Key source)
                 throws IOException
Sets alias for a comment on a verse range I.e. setRawText() was for verse range Gen.1.1-3 then setAliasKey should be called for Gen.1.1.2 and Gen.1.1.3

Parameters:
alias - Alias Key
source - Source Key
Throws:
IOException - Exception when anything goes wrong on writing the alias

Copyright ? 2003-2011