|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.DefaultBook
public class DefaultBook
Defines a single default book.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
private Book |
book
The default book |
private BookList |
books
The list of candidate books. |
private BookFilter |
filter
The filter against books that returns candidates. |
private static Logger |
log
The log stream |
Constructor Summary | |
---|---|
DefaultBook(BookList bookList,
BookFilter bookFilter)
|
Method Summary | |
---|---|
protected void |
checkReplacement()
Go through all of the current books checking to see if we need to replace the current defaults with one of these. |
Book |
getDefault()
Get the current default book or null if there is none. |
String |
getDefaultName()
This method is identical to getDefault().getFullName()
and is only used by Config which works best with strings under reflection. |
void |
setDefault(Book newBook)
Set the default Book. |
void |
setDefaultByName(String name)
Trawl through all the known Books satisfying the filter looking for the one matching the given name. |
void |
setDefaultConditionally(Book newBook)
Set the default Book conditionally. |
protected void |
unsetDefault()
Unset the current default book and attempt to appoint another. |
protected void |
unsetDefaultConditionally(Book oldBook)
Unset the current default book, if it matches the argument and attempt to appoint another. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Book book
private final BookList books
private final BookFilter filter
private static final Logger log
Constructor Detail |
---|
public DefaultBook(BookList bookList, BookFilter bookFilter)
Method Detail |
---|
public void setDefault(Book newBook)
newBook
- The version to use as default.public void setDefaultConditionally(Book newBook)
newBook
- The version to use as default.protected void unsetDefault()
protected void unsetDefaultConditionally(Book oldBook)
public Book getDefault()
public String getDefaultName()
getDefault().getFullName()
and is only used by Config which works best with strings under reflection.
public void setDefaultByName(String name)
This method is for use with config scripts and other things that need to work with Strings. The preferred method is to use Book objects.
This method is picky in that it only matches when the driver and the version are the same. The user (probably) only cares about the version though, and so might be dissapointed when we fail to match AV (FooDriver) against AV (BarDriver).
name
- The version to use as default.protected void checkReplacement()
|
Copyright ยจ 2003-2006 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |