|
||||||||||
| 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.
for license details.
The copyright to this program is held by it's authors.| 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. |
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, getVersification, isSupported, isWritable, readToOsis |
| 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)
| Method Detail |
|---|
public GenBookBackendState initState()
throws BookException
StatefulFileBackedBackend
BookExceptionpublic boolean contains(Key key)
AbstractBackend
contains in class AbstractBackend<GenBookBackendState>key - The key whose presence 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
IOExceptionpublic Key readIndex()
AbstractBackend
readIndex in class AbstractBackend<GenBookBackendState>
public void setAliasKey(GenBookBackendState state,
Key alias,
Key source)
throws IOException
StatefulFileBackedBackend
alias - Alias Keysource - Source Key
IOException - Exception when anything goes wrong on writing the alias
public 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-2011 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||