|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crosswire.jsword.book.basic.AbstractBook
public abstract class AbstractBook
AbstractBook implements a few of the more generic methods of Book. This class does a lot of work in helping make search easier, and implementing some basic write methods.
The GNU Lesser General Public License for details.| Field Summary | |
|---|---|
private Backend |
backend
To read the data from the Book |
private BookMetaData |
bmd
The meta data for this book |
private List<IndexStatusListener> |
listeners
The list of property change listeners |
private Searcher |
searcher
How do we perform searches |
| Constructor Summary | |
|---|---|
AbstractBook(BookMetaData bmd,
Backend backend)
Construct an AbstractBook given the BookMetaData and the AbstractBackend. |
|
| Method Summary | |
|---|---|
void |
activate(Lock lock)
Called to indicate that the Book should initialize itself, and consume whatever system resources it needs to be able to respond to other queries. |
void |
addIndexStatusListener(IndexStatusListener listener)
Adds a IndexStatusListener to the listener list. |
int |
compareTo(Book obj)
|
void |
deactivate(Lock lock)
Called to indicate that the Book should release whatever system resources it can to make way for other uses. |
boolean |
equals(Object obj)
|
Key |
find(SearchRequest request)
Retrieval: For a given search spec find a list of references to it. |
Key |
find(String request)
Retrieval: For a given search spec find a list of references to it. |
protected void |
firePropertyChange(IndexStatus oldStatus,
IndexStatus newStatus)
Reports bound property changes. |
String |
getAbbreviation()
The abbreviation of this book - how people familiar with this book will know it, for example "NIV", "KJV". |
Backend |
getBackend()
|
Book |
getBook()
Get this book. |
BookCategory |
getBookCategory()
What category of content is this, a Bible or a reference work like a Dictionary or Commentary. |
BookMetaData |
getBookMetaData()
Meta-Information: What version of the Bible is this? |
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. |
IndexStatus |
getIndexStatus()
Has anyone generated a search index for this Book? |
String |
getInitials()
The internal name of this book. |
Language |
getLanguage()
The language of the book. |
String |
getName()
The name of the book, for example "King James Version" or "Bible in Basic English" or "Greek". |
protected abstract List<org.jdom2.Content> |
getOsis(Key key,
RawTextToXmlProcessor noOpRawTextProcessor)
|
String |
getOsisID()
Calculated field: Get an OSIS identifier for the OsisText.setOsisIDWork() and the Work.setOsisWork() methods. |
String |
getProperty(String key)
Retrieve a single property for this book. |
Set<String> |
getPropertyKeys()
Get a list of all the properties available to do with this Book. |
Key |
getScope()
Get a complete list of entries. |
String |
getUnlockKey()
Gets the unlock key for the module. |
boolean |
hasFeature(FeatureType feature)
Return whether the feature is supported by the book. |
int |
hashCode()
|
boolean |
isEnciphered()
Indicate whether this book is enciphered. |
boolean |
isLeftToRight()
Return the orientation of the script of the Book. |
boolean |
isLocked()
Indicate whether this book is enciphered and without a key. |
boolean |
isQuestionable()
Indicate whether this book is questionable. |
boolean |
isSupported()
Indicate whether this book is supported by JSword. |
private boolean |
isUnlockKeyValid()
This is a heuristic that tries out the key. |
boolean |
match(String name)
Return the likelihood that we have a match. |
void |
putProperty(String key,
String value)
Set a property for this book. |
void |
putProperty(String key,
String value,
boolean forFrontend)
Saves an entry to a particular configuration file. |
void |
removeIndexStatusListener(IndexStatusListener listener)
Removes a IndexStatusListener from the listener list. |
void |
setBookMetaData(BookMetaData bmd)
Set the meta-information for this book. |
void |
setIndexStatus(IndexStatus newStatus)
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.jdom2.Document |
toOSIS()
Get an OSIS representation of information concerning this Book. |
String |
toString()
|
boolean |
unlock(String unlockKey)
Unlocks a book with the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.crosswire.jsword.book.Book |
|---|
contains, createEmptyKeyList, getGlobalKeyList, getKey, getOsisIterator, getRawText, getValidKey, isWritable, setAliasKey, setRawText |
| Field Detail |
|---|
private Searcher searcher
private BookMetaData bmd
private Backend backend
private List<IndexStatusListener> listeners
| Constructor Detail |
|---|
public AbstractBook(BookMetaData bmd,
Backend backend)
bmd - the metadata that describes the bookbackend - the means by which the resource is accessed| Method Detail |
|---|
public Key getScope()
BookBook.getGlobalKeyList(), however for a Bible, it will
get the references that are actually in the book.
getScope in interface Bookpublic final BookMetaData getBookMetaData()
Book
getBookMetaData in interface Bookpublic final void setBookMetaData(BookMetaData bmd)
Book
setBookMetaData in interface Bookbmd - the BookMetaData that describes this book.public final Backend getBackend()
public void activate(Lock lock)
Activatable
activate in interface Activatablelock - An attempt to ensure that only the Activator calls this methodpublic void deactivate(Lock lock)
Activatable
deactivate in interface Activatablelock - An attempt to ensure that only the Activator calls this method
public Key find(String request)
throws BookException
Book
find in interface Bookrequest - The search spec.
BookException - If anything goes wrong with this method
public Key find(SearchRequest request)
throws BookException
Book
find in interface Bookrequest - The search spec.
BookException - If anything goes wrong with this methodpublic Book getBook()
public BookDriver getDriver()
Book
getDriver in interface Bookpublic String getDriverName()
Book
getDriverName in interface Bookpublic boolean match(String name)
Book
match in interface Bookname - one of many ways to name this book.
public IndexStatus getIndexStatus()
Book
getIndexStatus in interface BookIndexManagerpublic void setIndexStatus(IndexStatus newStatus)
Book
setIndexStatus in interface BooknewStatus - the status to set for this bookIndexManagerpublic String getAbbreviation()
Book
getAbbreviation in interface Bookpublic String getInitials()
Book
getInitials in interface Bookpublic Language getLanguage()
Book
getLanguage in interface Bookpublic String getName()
Book
getName in interface Bookpublic String getOsisID()
Book
getOsisID in interface Bookpublic Set<String> getPropertyKeys()
Book
getPropertyKeys in interface Bookpublic String getProperty(String key)
Book
getProperty in interface Bookkey - the key of the property.
public void putProperty(String key,
String value)
Book
putProperty in interface Bookkey - the key of the property.value - the value of the property
public void putProperty(String key,
String value,
boolean forFrontend)
Book
putProperty in interface Bookkey - the entry that we are savingvalue - the value of the entryforFrontend - when true save to front end storage, else in shared storagepublic BookCategory getBookCategory()
Book
getBookCategory in interface Bookpublic boolean isLeftToRight()
Book
isLeftToRight in interface Bookpublic boolean isSupported()
Book
isSupported in interface Bookpublic boolean isEnciphered()
Book
isEnciphered in interface Bookpublic boolean isLocked()
Book
isLocked in interface Bookpublic boolean unlock(String unlockKey)
Book
unlock in interface BookunlockKey - the key to try
private boolean isUnlockKeyValid()
protected abstract List<org.jdom2.Content> getOsis(Key key,
RawTextToXmlProcessor noOpRawTextProcessor)
throws BookException
BookExceptionpublic String getUnlockKey()
Book
getUnlockKey in interface Bookpublic boolean isQuestionable()
Book
isQuestionable in interface Bookpublic boolean hasFeature(FeatureType feature)
Book
hasFeature in interface Bookfeature - the type of the Feature to check
public void addIndexStatusListener(IndexStatusListener listener)
BookIndexStatusListener to the listener list.
A IndexStatusEvent will get fired in response to
setIndexStatus.
addIndexStatusListener in interface Booklistener - the IndexStatusListener to be addedpublic void removeIndexStatusListener(IndexStatusListener listener)
BookIndexStatusListener from the listener list.
removeIndexStatusListener in interface Booklistener - the IndexStatusListener to be removed
protected void firePropertyChange(IndexStatus oldStatus,
IndexStatus newStatus)
oldValue and
newValue are not equal and the
PropertyChangeEvent listener list isn't empty, then fire a
PropertyChange event to each listener.
oldStatus - the old value of the property (as an Object)newStatus - the new value of the property (as an Object)public org.jdom2.Document toOSIS()
Book
toOSIS in interface Bookpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(Book obj)
compareTo in interface Comparable<Book>public String toString()
toString in class Object
|
Copyright ยจ 2003-2015 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||