|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.AbstractBookList
org.crosswire.jsword.book.Books
public final class Books
The Books class (along with Book) is the central point of contact between the rest of the world and this set of packages.
The GNU Lesser General Public License for details.
Field Summary | |
---|---|
private Set<Book> |
books
The collection of Books |
private Set<BookDriver> |
drivers
An array of BookDrivers |
private Map<String,Book> |
initials
The map of book initials |
private static Books |
instance
The singleton instance. |
private static org.slf4j.Logger |
log
The log stream |
private Map<String,Book> |
names
The map of book names |
Constructor Summary | |
---|---|
private |
Books()
Create a singleton instance of the class. |
Method Summary | |
---|---|
void |
addBook(Book book)
Add a Book to the current list of Books. |
private void |
autoRegister()
Registers all the drivers known to the program. |
Book |
getBook(String name)
Search for the book by initials and name. |
List<Book> |
getBooks()
Get a list of all the Books of all types. |
List<Book> |
getBooks(BookFilter filter)
Get a filtered list of all the Books. |
BookDriver[] |
getDrivers()
Get an array of all the known drivers |
BookDriver[] |
getDriversByClass(Class<? extends BookDriver> type)
Since Books keeps a track of drivers itself, including creating them when registered it can be hard to get a hold of the current book driver. |
static Books |
installed()
Accessor for the singleton instance |
void |
registerDriver(BookDriver driver)
Register the driver, adding its books to the list. |
void |
removeBook(Book book)
Remove a Book from the current list of Books. |
Methods inherited from class org.crosswire.jsword.book.AbstractBookList |
---|
addBooksListener, fireBooksChanged, removeBooksListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Set<Book> books
private Map<String,Book> initials
private Map<String,Book> names
private Set<BookDriver> drivers
private static final org.slf4j.Logger log
private static final Books instance
Constructor Detail |
---|
private Books()
Method Detail |
---|
public static Books installed()
public List<Book> getBooks()
BookList
public List<Book> getBooks(BookFilter filter)
BookList
getBooks
in interface BookList
getBooks
in class AbstractBookList
filter
- the filter to apply to the list of books
BookFilters
public Book getBook(String name)
name
- The initials or name of the book to find
public void addBook(Book book)
book
- the book to add to this book listpublic void removeBook(Book book) throws BookException
book
- the book to be removed from this book list
BookException
- when an error occurs when performing this methodpublic void registerDriver(BookDriver driver) throws BookException
driver
- The BookDriver to add
BookException
- when an error occurs when performing this methodpublic BookDriver[] getDriversByClass(Class<? extends BookDriver> type)
type
- the type of BookDriver
public BookDriver[] getDrivers()
private void autoRegister()
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |