|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.sword.AbstractBackend<GenBookBackendState>
org.crosswire.jsword.book.sword.GenBookBackend
public class GenBookBackend
Backend for General Books.
The GNU Lesser General Public License for details.
Field Summary | |
---|---|
private TreeKeyIndex |
index
The raw index file |
private static org.slf4j.Logger |
log
The log stream |
Constructor Summary | |
---|---|
GenBookBackend(SwordBookMetaData sbmd)
Simple ctor |
Method Summary | |
---|---|
boolean |
contains(Key key)
Determine whether this Book contains the key in question |
private void |
doReadIndex(TreeNode parentNode,
Key parentKey)
A helper function to recursively read the entire tree. |
private TreeNode |
find(Key key)
Given a Key, find the TreeNode for it. |
int |
getRawTextLength(Key key)
Determine the size of the raw data for the key in question. |
GenBookBackendState |
initState()
Initialises the state required to read from files, specific to each different backend |
Key |
readIndex()
Initialize a AbstractBackend before use. |
String |
readRawContent(GenBookBackendState state,
Key key)
|
void |
setAliasKey(GenBookBackendState state,
Key alias,
Key source)
Sets alias for a comment on a verse range I.e. |
void |
setRawText(GenBookBackendState rafBook,
Key key,
String text)
Set the text allotted for the given verse |
Methods inherited from class org.crosswire.jsword.book.sword.AbstractBackend |
---|
create, decipher, encipher, getBookMetaData, getGlobalKeyList, getRawText, isSupported, isWritable, readToOsis, setAliasKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final TreeKeyIndex index
private static final org.slf4j.Logger log
Constructor Detail |
---|
public GenBookBackend(SwordBookMetaData sbmd)
sbmd
- Method Detail |
---|
public GenBookBackendState initState() throws BookException
StatefulFileBackedBackend
BookException
public boolean contains(Key key)
Backend
contains
in interface Backend<GenBookBackendState>
contains
in class AbstractBackend<GenBookBackendState>
key
- The key whose presence is desired.
public int getRawTextLength(Key key)
Backend
getRawTextLength
in interface Backend<GenBookBackendState>
getRawTextLength
in class AbstractBackend<GenBookBackendState>
key
- The key whose raw data length is desired.
public String readRawContent(GenBookBackendState state, Key key) throws IOException, BookException
state
- the state object containing all the open random access fileskey
- the verse that is sought
IOException
- something went wrong when reading the verse
BookException
private TreeNode find(Key key) throws IOException
key
- The key to use for searching
IOException
public Key readIndex()
Backend
readIndex
in interface Backend<GenBookBackendState>
readIndex
in class AbstractBackend<GenBookBackendState>
public void setAliasKey(GenBookBackendState state, Key alias, Key source) throws IOException
StatefulFileBackedBackend
state
- the open file statealias
- Alias Keysource
- Source Key
IOException
- Exception when anything goes wrong on writing the aliaspublic void setRawText(GenBookBackendState rafBook, Key key, String text) throws BookException, IOException
StatefulFileBackedBackend
rafBook
- TODOkey
- The key to set text totext
- The text to be set for key
BookException
- If the data can not be set.
IOException
- If the module data path could not be created.private void doReadIndex(TreeNode parentNode, Key parentKey) throws IOException
parentNode
- the current node whose children are being soughtparentKey
-
IOException
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |