Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.bible.book
Interface Bible  view Bible download Bible.java

All Superinterfaces:
Book
All Known Subinterfaces:
StudyBible
All Known Implementing Classes:
AbstractBible

public interface Bible
extends Book

Bible is the core interface to a Bible store.

The methods of this interface come into 3 categories: Meta-Information methods return information about the implementation and its environment. Retrieval methods are the core methods that give access to the real Biblical text. These are the core of the interface. Generation methods are there to allow this Version to be generated. TODO: Generalize this for the Book interface
Distribution Licence:
Project B 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, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.

Version:
D8.I7.T2

Method Summary
 void addProgressListener(ProgressListener li)
          Generation: Add a progress listener to the list of things wanting to know whenever we make some progress
 com.eireneh.bible.passage.Passage findPassage(java.lang.String word)
          Retrieval: For a given word find a list of references to it
 void generate(Bible version)
          Generation: Read from the given source version to generate ourselves.
 void getDocument(BibleEle doc, com.eireneh.bible.passage.Passage ref)
          Deprecated. Use JDOM instead
 BibleDriver getDriver()
          Meta-Information: What driver is controlling this Bible?
 org.jdom.Element getElement(com.eireneh.bible.passage.Passage ref)
          Retrieval: Use JDOM to retrieve some Bible data
 java.lang.String getName()
          Meta-Information: What name can I use to get this Bible in a call to Bibles.getBible(name);.
 com.eireneh.config.Config getProperties()
          Meta-Information: What configuration options are available.
 java.net.URL getPropertiesURL()
          Meta-Information: If there is something to configure, and the config options are worth saving to disk (this may not be the case for read-only options) then this is where to save the stuff to.
 java.lang.String[] getStartsWith(java.lang.String base)
          Retrieval: Return an array of words that are used by this Bible that start with the given string.
 java.lang.String getText(com.eireneh.bible.passage.VerseRange range)
          Retrieval: Create an String for the specified Verses.
 Version getVersion()
          Meta-Information: What version of the Bible is this?
 java.util.Enumeration listWords()
          Retrieval: Get a list of the words used by this Version.
 void removeProgressListener(ProgressListener li)
          Generation: Remove a progress listener from the list of things wanting to know whenever we make some progress
 

Method Detail

getDriver

public BibleDriver getDriver()
Meta-Information: What driver is controlling this Bible?


getName

public java.lang.String getName()
Meta-Information: What name can I use to get this Bible in a call to Bibles.getBible(name);. I'm not sure that with the getVersion() method this makes a huge amount of sense. Might we be better off making people ask for a Bible by version and maybe driver rather than by name?


getVersion

public Version getVersion()
Meta-Information: What version of the Bible is this?


getProperties

public com.eireneh.config.Config getProperties()
                                        throws BookException
Meta-Information: What configuration options are available. A null return from this IS valid, and means, there aren't options to configure.


getPropertiesURL

public java.net.URL getPropertiesURL()
Meta-Information: If there is something to configure, and the config options are worth saving to disk (this may not be the case for read-only options) then this is where to save the stuff to.


getText

public java.lang.String getText(com.eireneh.bible.passage.VerseRange range)
                         throws BookException
Retrieval: Create an String for the specified Verses. There is a trivial implementation of this (slightly simplified):
   BibleEle doc = BibleEle.createDocument();
   getDocument(doc, range);
   return doc.getText();
 
So maybe this is redundant? A simple text-only Book could have a custom implementation of this that saves going near any XML. This could be particularly useful for Psion type implementaions

There is some debate in my mind as to whether this should be more like: String getText(Verse v). The problem with this version is that it doesn't tell you about where the verse ends. It is just raw text, so if you want to know about verse endings you will need to call this several times (as you would have to with the alternative) however means there is more Object creation to be done.


getDocument

public void getDocument(BibleEle doc,
                        com.eireneh.bible.passage.Passage ref)
                 throws BookException
Deprecated. Use JDOM instead

Retrieval: Add to the given document some mark-up for the specified Verses.


getElement

public org.jdom.Element getElement(com.eireneh.bible.passage.Passage ref)
                            throws BookException
Retrieval: Use JDOM to retrieve some Bible data


findPassage

public com.eireneh.bible.passage.Passage findPassage(java.lang.String word)
                                              throws BookException
Retrieval: For a given word find a list of references to it


listWords

public java.util.Enumeration listWords()
                                throws BookException
Retrieval: Get a list of the words used by this Version. This is not vital for normal display, however it is very useful for various things, not least of which is new Version generation. However if you are only looking to display from this Bible then you could skip this one.

I am tempted to make this mandatory since failing to implement this method will just make your Book harder to generate new Books from. This needs some thought.


getStartsWith

public java.lang.String[] getStartsWith(java.lang.String base)
                                 throws BookException
Retrieval: Return an array of words that are used by this Bible that start with the given string. For example calling: getStartsWith("love") will return something like: { "love", "loves", "lover", "lovely", ... } This is only needed to make your this driver play well in searches it is not vital for normal display. To save yourself the bother of implementing this properly you could do: return new String[] { base };


generate

public void generate(Bible version)
              throws BookException
Generation: Read from the given source version to generate ourselves. It should periodically call: Thread.currentThread().isInterrupted() to check that it is safe to continue, and clear up if not.


addProgressListener

public void addProgressListener(ProgressListener li)
Generation: Add a progress listener to the list of things wanting to know whenever we make some progress


removeProgressListener

public void removeProgressListener(ProgressListener li)
Generation: Remove a progress listener from the list of things wanting to know whenever we make some progress