|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AbstractBook
An interface to be implemented by classes that can act as Pavlov books. As of Pavlov 1.0, the only implementation is Book, which reads a book from an XML file. However, there's no reason that an implementation couldn't be written to generate its chapters and questions programmatically, i.e., an arithmetic book with chapters "Addition" and "Subtraction" who generate questions algorithmically from the question ID.
Method Summary | |
---|---|
String |
getAuthor()
Returns name of the author/maintainer of this book. |
Chapter |
getChapter(String cpName)
Returns the named chapter, or null if it doesn't exist |
Collection<AbstractChapter> |
getChaptersReadOnly()
Returns the book's chapters as a read-only collection. |
String |
getCover()
Returns filename of a descriptive image of this book. |
String |
getDescription()
Returns textual description of this book's contents. |
String |
getName()
Returns descriptive name of this book. |
int |
getNumberOfQuestions()
Sums the number of questions of all my chapters and returns the total. |
String |
getTitle()
Deprecated. use getName() instead. |
Collection<AbstractChapter> |
getValues()
Deprecated. |
void |
populateTree(DefaultMutableTreeNode bk)
Displays chapters as a tree. |
void |
save(File directory)
|
String |
toString()
Returns the book's name |
void |
toXML(Writer writer)
Dumps the Book in XML format to the given writer. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
String getAuthor()
String
valueChapter getChapter(String cpName)
cpName
- a String
value
Chapter
valueString getCover()
String
valueString getDescription()
String
valueString getName()
String
valueint getNumberOfQuestions()
int
value@Deprecated String getTitle()
getTitle
method here.
String
value@Deprecated Collection<AbstractChapter> getValues()
Collection
valueCollection<AbstractChapter> getChaptersReadOnly()
Collection
valuevoid populateTree(DefaultMutableTreeNode bk)
bk
- a DefaultMutableTreeNode
valueString toString()
toString
in class Object
String
valuevoid toXML(Writer writer) throws IOException
writer
- a Writer
value
IOException
- if an error occursvoid save(File directory) throws IOException
IOException
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |