|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.sword.AbstractBackend<T>
org.crosswire.jsword.book.sword.AbstractKeyBackend<RawLDBackendState>
org.crosswire.jsword.book.sword.RawLDBackend<T>
T
- The type of the RawLDBackendState that this class extends.public class RawLDBackend<T extends RawLDBackendState>
An implementation AbstractKeyBackend to read RAW format files.
The GNU Lesser General Public License for details.
,
Serialized FormField Summary | |
---|---|
private int |
datasize
The number of bytes in the size count in the index |
private static MessageFormat |
DATE_KEY_FORMAT
Date formatter |
private int |
entrysize
The number of bytes for each entry in the index: either 6 or 8 |
private static int |
OFFSETSIZE
How many bytes in the offset pointers in the index |
private static long |
serialVersionUID
Serialization ID |
private static Pattern |
STRONGS_PATTERN
This is the pattern of a Strong's Number. |
Constructor Summary | |
---|---|
RawLDBackend(SwordBookMetaData sbmd,
int datasize)
Simple ctor |
Method Summary | |
---|---|
private String |
external2internal(String externalKey,
String pattern)
Convert the supplied key to something that can be understood by the module. |
Key |
get(int index)
Gets a key from a specific point in this list of children. |
int |
getCardinality()
Returns the number of elements in this set (its cardinality). |
protected DataEntry |
getEntry(RawLDBackendState state,
DataEntry entry)
Get the entry indicated by this entry. |
private DataEntry |
getEntry(RawLDBackendState state,
String reply,
int index)
Get the text for an indexed entry in the book. |
private DataIndex |
getIndex(RawLDBackendState state,
long entry)
Get the Index (that is offset and size) for an entry. |
protected String |
getRawText(DataEntry entry)
|
int |
getRawTextLength(Key key)
Determine the size of the raw data for the key in question. |
private DecimalFormat |
getZero4Pad()
A means to normalize Strong's Numbers. |
private DecimalFormat |
getZero5Pad()
A means to normalize Strong's Numbers. |
int |
indexOf(Key that)
Reverse a Key into the position the key holds in the list of children |
RawLDBackendState |
initState()
Initialises the state required to read from files, specific to each different backend |
private String |
internal2external(String internalKey)
|
private String |
normalizeForSearch(String internalKey)
|
private void |
readObject(ObjectInputStream is)
Serialization support. |
String |
readRawContent(RawLDBackendState state,
Key key)
|
private String |
readRawContent(RawLDBackendState state,
String key)
|
private int |
search(RawLDBackendState state,
String key)
Find a matching entry, returning it's index. |
Methods inherited from class org.crosswire.jsword.book.sword.AbstractKeyBackend |
---|
addAll, blur, canHaveChildren, clear, clone, compareTo, contains, equals, getChildCount, getName, getName, getOsisID, getOsisRef, getParent, getRootName, hashCode, isEmpty, iterator, removeAll, retainAll, setAliasKey, setRawText |
Methods inherited from class org.crosswire.jsword.book.sword.AbstractBackend |
---|
create, decipher, encipher, getBookMetaData, getGlobalKeyList, getRawText, isSupported, isWritable, readIndex, readToOsis, setAliasKey |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final MessageFormat DATE_KEY_FORMAT
private static final Pattern STRONGS_PATTERN
private final int datasize
private final int entrysize
private static final int OFFSETSIZE
private static final long serialVersionUID
Constructor Detail |
---|
public RawLDBackend(SwordBookMetaData sbmd, int datasize)
sbmd
- datasize
- We need to know how many bytes in the size portion of the
indexMethod Detail |
---|
public String readRawContent(RawLDBackendState state, Key key) throws IOException
state
- the state object containing all the open random access fileskey
- the verse that is sought
IOException
- something went wrong when reading the versepublic RawLDBackendState initState() throws BookException
StatefulFileBackedBackend
BookException
private String readRawContent(RawLDBackendState state, String key) throws IOException
IOException
protected String getRawText(DataEntry entry)
public int getCardinality()
Key
This method is potentially expensive, as it often requires cycling through all the keys in the set.
public Key get(int index)
Key
index
- The index of the Key to retrieve
public int indexOf(Key that)
Key
that
- The Key to find
public int getRawTextLength(Key key)
Backend
getRawTextLength
in interface Backend<RawLDBackendState>
getRawTextLength
in class AbstractBackend<RawLDBackendState>
key
- The key whose raw data length is desired.
private DataIndex getIndex(RawLDBackendState state, long entry) throws IOException
entry
-
IOException
private DataEntry getEntry(RawLDBackendState state, String reply, int index) throws IOException
index
- the entry to get
IOException
protected DataEntry getEntry(RawLDBackendState state, DataEntry entry)
state
- the state where the entry can be foundentry
- the entry that might indicate a deeper entry
private int search(RawLDBackendState state, String key) throws IOException
key
-
IOException
private String external2internal(String externalKey, String pattern)
externalKey
- The external key to normalizepattern
- The first non-introduction key in the module.
private String internal2external(String internalKey)
private String normalizeForSearch(String internalKey)
private DecimalFormat getZero5Pad()
private DecimalFormat getZero4Pad()
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException
is
-
IOException
ClassNotFoundException
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |