org.crosswire.jsword.book
Interface BookMetaData

All Superinterfaces:
Comparable
All Known Subinterfaces:
Book
All Known Implementing Classes:
AbstractBook, AbstractBookMetaData, DefaultBookMetaData, PassageAbstractBook, ReadingsBook, SwordBook, SwordBookMetaData, SwordDictionary

public interface BookMetaData
extends Comparable

A BookMetaData represents a method of translating the Bible. All Books with the same BookMetaData should return identical text for any call to Bible.getText(VerseRange). The implication of this is that there may be many instances of the Version "NIV", as there are several different versions of the NIV - Original American-English, Anglicized, and Inclusive Language editions at least.

BookMetaData like Strings must be compared using .equals() instead of ==. A Bible must have the ability to handle a book unknown to JSword. So Books must be able to add versions to the system, and the system must cope with books that already exist.

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: BookMetaData.java,v 1.26 2005/03/21 02:37:28 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
static String KEY_BOOK
          The key for the book in the properties map
static String KEY_DRIVER
          The key for the driver in the properties map
static String KEY_INDEXSTATUS
          The key for the indexed status in the properties map
static String KEY_INITIALS
          The key for the initials in the properties map
static String KEY_LANGUAGE
          The key for the name in the properties map
static String KEY_NAME
          The key for the name in the properties map
static String KEY_TYPE
          The key for the type in the properties map
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener li)
          Adds a PropertyChangeListener to the listener list.
 BookDriver getDriver()
          Accessor for the driver that runs this Book.
 String getDriverName()
          Calculated field: The name of the name, which could be helpful to distinguish similar Books available through 2 BookDrivers.
 String getFullName()
          Calculated field: The full name of the book, for example The format is "name, (Driver)"
 IndexStatus getIndexStatus()
          Has anyone generated a search index for this Book?
 String getInitials()
          The initials of this book - how people familiar with this book will know it, for example "NIV", "KJV".
 String getLanguage()
          The language of the book is the common name for the iso639 code.
 String getName()
          The name of the book, for example "King James Version" or "Bible in Basic English" or "Greek".
 String getOsisID()
          Calculated field: Get an OSIS identifier for the OsisText.setOsisIDWork() and the Work.setOsisWork() methods.
 Map getProperties()
          Get a list of all the properties available to do with this Book.
 BookType getType()
          What type of content is this, a Bible or a reference work like a Dictionary or Commentary
 boolean hasFeature(FeatureType feature)
          Return whether the feature is supported by the book.
 boolean isLeftToRight()
          Return the orientation of the language of the Book.
 void removePropertyChangeListener(PropertyChangeListener li)
          Removes a PropertyChangeListener from the listener list.
 void setIndexStatus(IndexStatus status)
          This method does not alter the index status, however it is for Indexers that are responsible for indexing and have changed the status themselves.
 org.jdom.Document toOSIS()
          Get an OSIS representation of information concerning this Book.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

KEY_TYPE

static final String KEY_TYPE
The key for the type in the properties map

See Also:
Constant Field Values

KEY_BOOK

static final String KEY_BOOK
The key for the book in the properties map

See Also:
Constant Field Values

KEY_DRIVER

static final String KEY_DRIVER
The key for the driver in the properties map

See Also:
Constant Field Values

KEY_NAME

static final String KEY_NAME
The key for the name in the properties map

See Also:
Constant Field Values

KEY_LANGUAGE

static final String KEY_LANGUAGE
The key for the name in the properties map

See Also:
Constant Field Values

KEY_INITIALS

static final String KEY_INITIALS
The key for the initials in the properties map

See Also:
Constant Field Values

KEY_INDEXSTATUS

static final String KEY_INDEXSTATUS
The key for the indexed status in the properties map

See Also:
Constant Field Values
Method Detail

getName

String getName()
The name of the book, for example "King James Version" or "Bible in Basic English" or "Greek". In general it should be possible to deduce the initials from the name by removing all the non-capital letters. Although this is only a generalization. This method should not return null or a blank string.

Returns:
The name of this book

getType

BookType getType()
What type of content is this, a Bible or a reference work like a Dictionary or Commentary

Returns:
The type of book

getDriver

BookDriver getDriver()
Accessor for the driver that runs this Book. Note this method should only be used to delete() Books. Everything else you should want to do to a Book should be available in other ways.


getLanguage

String getLanguage()
The language of the book is the common name for the iso639 code.

Returns:
the common name for the language

getInitials

String getInitials()
The initials of this book - how people familiar with this book will know it, for example "NIV", "KJV".

Returns:
The book's initials

getOsisID

String getOsisID()
Calculated field: Get an OSIS identifier for the OsisText.setOsisIDWork() and the Work.setOsisWork() methods. The response will generally be of the form [Bible][Dict..].getInitials

Returns:
The osis id of this book

getFullName

String getFullName()
Calculated field: The full name of the book, for example The format is "name, (Driver)"

Returns:
The full name of this book

getDriverName

String getDriverName()
Calculated field: The name of the name, which could be helpful to distinguish similar Books available through 2 BookDrivers.

Returns:
The driver name

isLeftToRight

boolean isLeftToRight()
Return the orientation of the language of the Book. If a book contains more than one language, it refers to the dominate language of the book. This will be used to present Arabic and Hebrew in their propper orientation.

Returns:
true if the orientation for the dominate language is LeftToRight.

hasFeature

boolean hasFeature(FeatureType feature)
Return whether the feature is supported by the book.


getProperties

Map getProperties()
Get a list of all the properties available to do with this Book. The returned Properties will be read-only so any attempts to alter it will fail.


getIndexStatus

IndexStatus getIndexStatus()
Has anyone generated a search index for this Book?

See Also:
IndexManager

setIndexStatus

void setIndexStatus(IndexStatus status)
This method does not alter the index status, however it is for Indexers that are responsible for indexing and have changed the status themselves.

See Also:
IndexManager

toOSIS

org.jdom.Document toOSIS()
Get an OSIS representation of information concerning this Book.


addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener li)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties. However the only one likely to change at the time of writing is the Index Status.

A PropertyChangeEvent will get fired in response to setting a bound property, such as setIndexStatus.

Parameters:
li - the PropertyChangeListener to be added

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener li)
Removes a PropertyChangeListener from the listener list.

Parameters:
li - the PropertyChangeListener to be removed

Copyright ? 2003-2004