|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pavlov.library.LibraryDocument net.sourceforge.pavlov.library.Chapter
public final class Chapter
Describes a chapter, which contains questions.
Question
,
Book
,
Library
,
Serialized FormField Summary |
---|
Fields inherited from class net.sourceforge.pavlov.library.LibraryDocument |
---|
author, description, name |
Constructor Summary | |
---|---|
Chapter()
Creates an untitled chapter. |
|
Chapter(String newName)
Creates a new Chapter instance. |
Method Summary | |
---|---|
void |
addQuestion(Question b)
Adds a question using it's ID as the key |
int |
compareTo(Object obj)
|
Chapter |
deepCopy()
Uses a nifty trick from "Design Patterns in Java" to make a completely independent copy of this chapter. |
boolean |
equals(Object obj)
Returns true if the given object is a chapter and all its elements are equal to mine. |
String |
getCover()
Returns the filename for a descriptive image. |
int |
getNumberOfQuestions()
Number of questions this chapter contains. |
Question |
getQuestion(String id)
Gets the question with the specified ID or null if it doesn't exist. |
TreeMap<String,Question> |
getQuestions()
Describe getQuestions method here. |
Collection<Question> |
getQuestionsCollection()
Deprecated. |
Collection<Question> |
getQuestionsReadOnly()
Returns the chapter's questions as a read-only collection. |
String |
getTitle()
Deprecated. Use getName() |
static Chapter |
makeBlankChapter()
Describe makeBlankChapter method here. |
void |
setCover(String n)
Sets the filename for a descriptive image. |
void |
setQuestions(Collection<Question> list)
Describe setQuestions method here. |
void |
setTitle(String n)
Deprecated. Use setTitle() |
String |
toString()
Returns the chapter's title |
void |
toXML(Writer writer)
Dumps the chapter in XML format to the given writer. |
Methods inherited from class net.sourceforge.pavlov.library.LibraryDocument |
---|
getAuthor, getDescription, getName, setAuthor, setDescription, setName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sourceforge.pavlov.library.AbstractChapter |
---|
getAuthor, getDescription |
Constructor Detail |
---|
public Chapter()
public Chapter(String newName)
Chapter
instance.
newName
- a String
valueMethod Detail |
---|
public Question getQuestion(String id)
getQuestion
in interface AbstractChapter
id
- a String
value
Question
valuepublic int compareTo(Object obj)
compareTo
in interface Comparable
public void setQuestions(Collection<Question> list)
setQuestions
method here.
public int getNumberOfQuestions()
getNumberOfQuestions
in interface AbstractChapter
int
value@Deprecated public String getTitle()
getTitle
in interface AbstractChapter
String
value@Deprecated public void setTitle(String n)
n
- a String
valuepublic String getCover()
getCover
in interface AbstractChapter
String
valuepublic void setCover(String n)
n
- a String
valuepublic void addQuestion(Question b)
b
- a Question
valuepublic void toXML(Writer writer) throws IOException
toXML
in interface AbstractChapter
writer
- a java.io.Writer
value
IOException
- if an error occurs@Deprecated public Collection<Question> getQuestionsCollection()
getQuestionsCollection
in interface AbstractChapter
Collection
valuepublic Collection<Question> getQuestionsReadOnly()
getQuestionsReadOnly
in interface AbstractChapter
Collection
valuepublic TreeMap<String,Question> getQuestions()
getQuestions
method here.
Hashtable
valuepublic String toString()
toString
in interface AbstractChapter
toString
in class Object
String
valuepublic static Chapter makeBlankChapter()
makeBlankChapter
method here.
Chapter
valuepublic boolean equals(Object obj)
equals
in class Object
obj
- an Object
value
boolean
valuepublic Chapter deepCopy()
Chapter
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |