org.crosswire.jsword.book.sword
Class Backend

java.lang.Object
  extended by org.crosswire.jsword.book.sword.Backend
All Implemented Interfaces:
Activatable
Direct Known Subclasses:
GZIPBackend, LZSSBackend, RawBackend, RawLDBackend, ZLDBackend

public abstract class Backend
extends Object
implements Activatable

A generic way to read data from disk for later formatting.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: Backend.java,v 1.13 2005/03/06 20:21:47 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private  SwordBookMetaData bmd
           
private  File rootPath
           
 
Constructor Summary
Backend(SwordBookMetaData sbmd, File location)
          Construct a minimal backend
 
Method Summary
 void decipher(byte[] data)
          Decipher the data in place, if it is enciphered and there is a key to unlock it.
 SwordBookMetaData getBookMetaData()
           
abstract  String getRawText(Key key)
          Get the bytes alotted for the given verse
 File getRootPath()
           
abstract  boolean isSupported()
          Returns whether this Backend is implemented.
abstract  Key readIndex()
          Initialise a Backend before use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.crosswire.common.activate.Activatable
activate, deactivate
 

Field Detail

bmd

private SwordBookMetaData bmd

rootPath

private File rootPath
Constructor Detail

Backend

public Backend(SwordBookMetaData sbmd,
               File location)
Construct a minimal backend

Parameters:
sbmd -
location -
Method Detail

getRootPath

public File getRootPath()
Returns:
Returns the root path.

getBookMetaData

public SwordBookMetaData getBookMetaData()
Returns:
Returns the Sword BookMetaData.

decipher

public 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

readIndex

public abstract Key readIndex()
Initialise a Backend before use. This method needs to call addKey() a number of times on SwordDictionary


getRawText

public abstract String getRawText(Key key)
                           throws BookException
Get the bytes alotted for the given verse

Parameters:
key - The key to fetch
Returns:
String The data for the verse in question
Throws:
BookException - If the data can not be read.

isSupported

public abstract boolean isSupported()
Returns whether this Backend is implemented.

Returns:
true if this Backend is implemented.

Copyright ? 2003-2004