org.crosswire.jsword.book
Class BookFilters

java.lang.Object
  extended by org.crosswire.jsword.book.BookFilters

public final class BookFilters
extends Object

Some common implementations of BookFilter.

Author:
Joe Walker
See Also:
The GNU Lesser General Public License for details.

Nested Class Summary
(package private) static class BookFilters.AllBookFilter
          Filter for all books
(package private) static class BookFilters.BookCategoryFilter
          Filter for books by category
static class BookFilters.BookFeatureFilter
          Filter for books by feature
(package private) static class BookFilters.CustomBookFilter
          Custom Filter
(package private) static class BookFilters.NotBookCategoryFilter
          Filter for books by category
 
Field Summary
private static boolean commentariesWithBibles
          Whether biblesBookFilter includes commentaries.
 
Constructor Summary
private BookFilters()
          Ensure we can't be created
 
Method Summary
static BookFilter both(BookFilter b1, BookFilter b2)
          A filter that accepts Books that match two criteria.
static BookFilter either(BookFilter b1, BookFilter b2)
          A filter that accepts Books that match either of two criteria.
static BookFilter getAll()
          A simple default filter that returns everything
static BookFilter getBibles()
          A filter that accepts everything that implements Bible or Commentary, when commentaries are listed with Bibles.
static BookFilter getBooksByDriver(BookDriver driver)
          A filter that accepts Books that match by book driver.
static BookFilter getCommentaries()
          A filter that accepts everything that implements Commentary
static BookFilter getCustom(String match)
          A simple default filter that returns everything.
static BookFilter getDailyDevotionals()
          A filter that accepts everything that implements DailyDevotionals
static BookFilter getDictionaries()
          A filter that accepts everything that implements Dictionary
static BookFilter getGeneralBooks()
          A filter that accepts everything that implements GeneralBook
static BookFilter getGlossaries()
          A filter that accepts everything that implements Dictionary
static BookFilter getGreekDefinitions()
          A filter that accepts everything that is a Greek Definition Dictionary
static BookFilter getGreekParse()
          A filter that accepts everything that is a Greek Parse/Morphology Dictionary
static BookFilter getHebrewDefinitions()
          A filter that accepts everything that is a Hebrew Definition Dictionary
static BookFilter getHebrewParse()
          A filter that accepts everything that is a Hebrew Parse/Morphology Dictionary
static BookFilter getMaps()
          A filter that accepts everything that implements Maps
static BookFilter getNonBibles()
          A filter that accepts everything that's not a Bible or a Commentary, when commentaries are listed with Bibles.
static BookFilter getOnlyBibles()
          A filter that accepts everything that implements Bible.
static boolean isCommentariesWithBibles()
          Determine whether the getBible should return the current Bible or the user's chosen default.
static void setCommentariesWithBibles(boolean current)
          Establish whether the getBible should return the current Bible or the user's chosen default.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commentariesWithBibles

private static boolean commentariesWithBibles
Whether biblesBookFilter includes commentaries. Initially false.

Constructor Detail

BookFilters

private BookFilters()
Ensure we can't be created

Method Detail

getAll

public static BookFilter getAll()
A simple default filter that returns everything

Returns:
the desired filter

getBibles

public static BookFilter getBibles()
A filter that accepts everything that implements Bible or Commentary, when commentaries are listed with Bibles.

Returns:
the desired filter

getOnlyBibles

public static BookFilter getOnlyBibles()
A filter that accepts everything that implements Bible.

Returns:
the desired filter

getNonBibles

public static BookFilter getNonBibles()
A filter that accepts everything that's not a Bible or a Commentary, when commentaries are listed with Bibles.

Returns:
the desired filter

getDictionaries

public static BookFilter getDictionaries()
A filter that accepts everything that implements Dictionary

Returns:
the desired filter

getGlossaries

public static BookFilter getGlossaries()
A filter that accepts everything that implements Dictionary

Returns:
the desired filter

getDailyDevotionals

public static BookFilter getDailyDevotionals()
A filter that accepts everything that implements DailyDevotionals

Returns:
the desired filter

getCommentaries

public static BookFilter getCommentaries()
A filter that accepts everything that implements Commentary

Returns:
the desired filter

getGeneralBooks

public static BookFilter getGeneralBooks()
A filter that accepts everything that implements GeneralBook

Returns:
the desired filter

getMaps

public static BookFilter getMaps()
A filter that accepts everything that implements Maps

Returns:
the desired filter

getGreekDefinitions

public static BookFilter getGreekDefinitions()
A filter that accepts everything that is a Greek Definition Dictionary

Returns:
the desired filter

getGreekParse

public static BookFilter getGreekParse()
A filter that accepts everything that is a Greek Parse/Morphology Dictionary

Returns:
the desired filter

getHebrewDefinitions

public static BookFilter getHebrewDefinitions()
A filter that accepts everything that is a Hebrew Definition Dictionary

Returns:
the desired filter

getHebrewParse

public static BookFilter getHebrewParse()
A filter that accepts everything that is a Hebrew Parse/Morphology Dictionary

Returns:
the desired filter

isCommentariesWithBibles

public static boolean isCommentariesWithBibles()
Determine whether the getBible should return the current Bible or the user's chosen default.

Returns:
true if the bible tracks the user's selection

setCommentariesWithBibles

public static void setCommentariesWithBibles(boolean current)
Establish whether the getBible should return the current Bible or the user's chosen default.

Parameters:
current - whether commentaries should be returned together with Bibles

both

public static BookFilter both(BookFilter b1,
                              BookFilter b2)
A filter that accepts Books that match two criteria.

Parameters:
b1 - the first filter criteria
b2 - the second filter criteria
Returns:
the desired filter

either

public static BookFilter either(BookFilter b1,
                                BookFilter b2)
A filter that accepts Books that match either of two criteria.

Parameters:
b1 - the first filter criteria
b2 - the second filter criteria
Returns:
the desired filter

getBooksByDriver

public static BookFilter getBooksByDriver(BookDriver driver)
A filter that accepts Books that match by book driver.

Parameters:
driver - the driver to match
Returns:
the desired filter

getCustom

public static BookFilter getCustom(String match)
A simple default filter that returns everything. The match parameter is a set of name value pairs like this:
initials=ESV;type=Bible;driverName=Sword
Before the = there must be the name of a property on Book and after the value to match (.toString()) is called on the results of the getter.

Parameters:
match - a ; separated list of properties (of Book) to match
Returns:
the desired filter
See Also:
Book

Copyright ยจ 2003-2015