Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.jsword.book.sword
Interface Backend<T extends OpenFileState>

Type Parameters:
  `T` - The type of the OpenFileState that this class extends.

All Known Implementing Classes:
  AbstractBackend, AbstractKeyBackend, GenBookBackend, NullBackend, RawBackend, RawFileBackend, RawLDBackend, ZLDBackend, ZVerseBackend

    public interface Backend<T extends OpenFileState>

Uniform representation of all Backends.

Author:
  DM Smith
See Also:
  `The GNU Lesser General Public License for details.`

Method Summary
`boolean` | `contains(Key key)` Determine whether this Book contains the key in question
`void` | `create()` Create the directory to hold the Book if it does not exist.
`void` | `decipher(byte[] data)` Decipher the data in place, if it is enciphered and there is a key to unlock it.
`void` | `encipher(byte[] data)` Encipher the data in place, if there is a key to unlock it.
`SwordBookMetaData` | `getBookMetaData()`
`Key` | `getGlobalKeyList()` Gets the fast global key list, and if this operation is not supported, throws a `UnsupportedOperationException`
`String` | `getRawText(Key key)` Get the text as it is found in the Book for the given key
`int` | `getRawTextLength(Key key)` Determine the size of the raw data for the key in question.
`boolean` | `isSupported()` Returns whether this AbstractBackend is implemented.
`boolean` | `isWritable()` A Backend is writable if the file system allows the underlying files to be opened for writing and if the backend has implemented writing.
`Key` | `readIndex()` Deprecated. no replacement
`List<org.jdom2.Content>` | `readToOsis(Key key, RawTextToXmlProcessor processor)` Get the text allotted for the given entry
`void` | `setAliasKey(Key alias, Key source)`

Method Detail

### getBookMetaData

    SwordBookMetaData getBookMetaData()

  Returns:
    Returns the Sword BookMetaData.

### decipher

    void decipher(byte[] data)

  Decipher the data in place, if it is enciphered and there is a key to unlock it.

  Parameters:
    `data` - the data to unlock

### encipher

    void encipher(byte[] data)

  Encipher the data in place, if there is a key to unlock it.

  Parameters:
    `data` -

### readIndex

    @Deprecated
    Key readIndex()

  Deprecated. no replacement

  Initialize a AbstractBackend before use. This method needs to call addKey() a number of times on GenBookBackend

  Returns:
    the list of all keys for the book

### contains

    boolean contains(Key key)

  Determine whether this Book contains the key in question

  Parameters:
    `key` - The key whose presence is desired.
  Returns:
    true if the Book contains the key

### getRawText

    String getRawText(Key key)
                      throws BookException

  Get the text as it is found in the Book for the given key

  Parameters:
    `key` - the key for which the raw text is desired.
  Returns:
    the text from the module
  Throws:
    `BookException`

### setAliasKey

    void setAliasKey(Key alias,
                     Key source)
                     throws BookException

  Throws:
    `BookException`

### getRawTextLength

    int getRawTextLength(Key key)

  Determine the size of the raw data for the key in question. This method may not be faster than getting the raw text and getting its size.

  Parameters:
    `key` - The key whose raw data length is desired.
  Returns:
    The length of the raw data, 0 if not a valid key.

### getGlobalKeyList

    Key getGlobalKeyList()
                         throws BookException

  Gets the fast global key list, and if this operation is not supported, throws a `UnsupportedOperationException`

  Returns:
    the fast global key list
  Throws:
    `BookException` - the book exception if for some reason the book failed to be read properly.

### readToOsis

    List<org.jdom2.Content> readToOsis(Key key,
                                       RawTextToXmlProcessor processor)
                                       throws BookException

  Get the text allotted for the given entry

  Parameters:
    `key` - The key to fetch
    `processor` - processor that executes before/after the content is read from disk or another kind of backend
  Returns:
    String The data for the verse in question
  Throws:
    `BookException` - If the data can not be read.

### create

    void create()
                throws IOException,
                       BookException

  Create the directory to hold the Book if it does not exist.

  Throws:
    `IOException`
    `BookException`

### isSupported

    boolean isSupported()

  Returns whether this AbstractBackend is implemented.

  Returns:
    true if this AbstractBackend is implemented.

### isWritable

    boolean isWritable()

  A Backend is writable if the file system allows the underlying files to be opened for writing and if the backend has implemented writing. Ultimately, all drivers should allow writing. At this time writing is not supported by most backends, so abstract implementations should return false and let specific implementations return true otherwise.

  Returns:
    true if the book is writable

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD