|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.sword.DataEntry
public class DataEntry
Data entry represents an entry in a Data file. The entry consists of a key and an optional payload. The payload may be the content, aka rawtext. The payload may be an alias for another entry. The payload may be a block locator.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
private String |
charset
The character set of the data entry. |
private byte[] |
data
The data entry as it comes out of the data file. |
private String |
key
The key in the data entry. |
private int |
keyEnd
The index of the separator between the key and the rest of the stuff. |
private int |
linkEnd
The index of the separator between the link and the rest of the stuff. |
private String |
name
A diagnostic name. |
private static byte |
SEPARATOR
Used to separate the key name from the key value Note: it may be \r\n or just \n, so only need \n. |
Constructor Summary | |
---|---|
DataEntry(String name,
byte[] data,
String charset)
Construct a data entry. |
Method Summary | |
---|---|
void |
cipher(byte[] cipherKey,
int offset)
Decipher/Encipher the data in place, if there is a cipher key. |
DataIndex |
getBlockIndex()
Get the block start and entry position. |
String |
getKey()
Get the key from this DataEntry. |
private int |
getKeyEnd()
Get the position of the first \n in the data. |
private int |
getLinkEnd()
Get the position of the second \n in the data. |
String |
getLinkTarget()
Get the link target for this entry. |
String |
getName()
Get the name, that is, the diagnostic label, for this DataEntry. |
String |
getRawText(byte[] cipherKey)
Get the raw text from this entry. |
boolean |
isLinkEntry()
Determine whether this entry is an alias for another. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final byte SEPARATOR
private String name
private byte[] data
private String charset
private String key
private int keyEnd
private int linkEnd
Constructor Detail |
---|
public DataEntry(String name, byte[] data, String charset)
name
- A name used for diagnostics.data
- The data for this entry.charset
- The character encoding for this entry.Method Detail |
---|
public String getName()
public String getKey()
public boolean isLinkEntry()
public String getLinkTarget()
isLinkEntry()
public String getRawText(byte[] cipherKey)
cipherKey
- the key, if any, to (un)lock the text
public DataIndex getBlockIndex()
private int getKeyEnd()
private int getLinkEnd()
public void cipher(byte[] cipherKey, int offset)
cipherKey
- the key to the cipher
|
Copyright ยจ 2003-2007 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |