|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.sword.AbstractBackend
org.crosswire.jsword.book.sword.RawLDBackend
public class RawLDBackend
An implementation KeyBackend to read RAW format files.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
private boolean |
active
Are we active |
private int |
datasize
How many bytes in the size count in the index |
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 Logger |
log
The log stream |
private static int |
OFFSETSIZE
How many bytes in the offset pointers in the index |
private static byte |
SEPARATOR
Used to separate the key name from the key value |
Constructor Summary | |
---|---|
RawLDBackend(SwordBookMetaData sbmd,
int datasize)
Simple ctor |
Method Summary | |
---|---|
void |
activate(Lock lock)
Called to indicate that the Book should initialize itself, and consume whatever system resources it needs to be able to respond to other queries. |
protected void |
checkActive()
Helper method so we can quickly activate ourselves on access |
void |
deactivate(Lock lock)
Called to indicate that the Book should release whatever system resources it can to make way for other uses. |
String |
getRawText(Key key)
Get the bytes alotted for the given verse |
Key |
readIndex()
Initialise a AbstractBackend before use. |
Methods inherited from class org.crosswire.jsword.book.sword.AbstractBackend |
---|
decipher, getBookMetaData, getExpandedDataPath, isSupported, isWritable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean active
private static final byte SEPARATOR
private static final int OFFSETSIZE
private int datasize
private RandomAccessFile datRaf
private RandomAccessFile idxRaf
private File datFile
private File idxFile
private static final Logger log
Constructor Detail |
---|
public RawLDBackend(SwordBookMetaData sbmd, int datasize) throws BookException
datasize
- We need to know how many bytes in the size portion of the index
BookException
Method Detail |
---|
public final void activate(Lock lock)
Activatable
lock
- An attempt to ensure that only the Activator calls this methodpublic final void deactivate(Lock lock)
Activatable
lock
- An attempt to ensure that only the Activator calls this methodpublic Key readIndex()
AbstractBackend
readIndex
in class AbstractBackend
public String getRawText(Key key) throws BookException
AbstractBackend
getRawText
in class AbstractBackend
key
- The key to fetch
BookException
- If the data can not be read.protected final void checkActive()
|
Copyright ยจ 2003-2007 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |