|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pavlov.user.User
public final class User
Describe class User
here.
Constructor Summary | |
---|---|
User()
Creates an empty user named "Unnamed" with password "empty." |
|
User(String name,
String password)
Creates a user with the given name and password. |
Method Summary | |
---|---|
void |
addBook(BookData b)
Adds the bookdata to this user. |
static void |
addQuizData(ChapterData who,
QuizData qdd)
Adds data for a quiz to this user. |
boolean |
checkPassword(String pass)
Returns true if pass is the user's password. |
void |
deleteQuestionID(String bkName,
String cpName,
String qn)
Deprecated. implement reverse validation in this class, then privatize this method |
boolean |
equals(Object o)
Returns true if 1) both are null, or 2) name and password are the same. |
protected String |
getBaseFileName()
Describe getBaseFileName method here. |
BookData |
getBookData(String bkName)
Gets data describing the users global history with the named book. |
ChapterData |
getChapterData(ChapterReference ref)
Describe getChapterData method here. |
ChapterData |
getChapterData(String bkName,
String cpName)
Deprecated. use getChapterData(ChapterReference) instead. |
String |
getName()
Returns this user's name. |
int |
getNumberOfQuestions(String bkName,
String cpName)
Number of questions in this book. |
QuestionData |
getQuestionData(String bkName,
String cpName,
String qid)
Describe getQuestionData method here. |
String |
getQuestionId(String bkName,
String cpName)
Returns a question from the given book & chapter using the current strategy. |
static QuizCollectionData |
getStatistics(ChapterData who)
Returns descriptive statistics about this user's past quizzes. |
UserFile |
getUserFile()
Gets the userfile to save this user to. |
static Question |
getValidQuestion(ChapterData chapDat,
AbstractChapter chapt)
Reverse-validation: if a user.QuestionData exists for a nonexistant library.question, unceremoniously remove the user.QuestionData. |
void |
save()
Saves this file to file userFile. |
void |
save(File directory)
Saves this file to the given directory. |
void |
setName(String n)
Sets this user's name. |
void |
setPassword(String n)
Sets this user's password. |
void |
setUserFile(UserFile f)
Sets the userfile for saving/loading this user. |
void |
toXML(Writer writer)
Sends a representation of this user in XML form to the given writer. |
void |
validate(AbstractLibrary l)
Ensures the user has QuestionData for all the questions in this book, creating QuestionData as necessary. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public User(String name, String password)
name
- a String
valuepassword
- a String
valuepublic User()
Method Detail |
---|
public boolean checkPassword(String pass)
pass
- a String
value
boolean
valuepublic boolean equals(Object o)
equals
in class Object
o
- an Object
value
boolean
valuepublic BookData getBookData(String bkName)
bkName
- a String
value
BookData
valuepublic void validate(AbstractLibrary l)
l
- an AbstractLibrary
value@Deprecated public QuestionData getQuestionData(String bkName, String cpName, String qid)
getQuestionData
method here.
bkName
- a String
valuecpName
- a String
valueqid
- a String
value
QuestionData
value@Deprecated public int getNumberOfQuestions(String bkName, String cpName)
bkName
- a String
valuecpName
- a String
value
int
value@Deprecated public void deleteQuestionID(String bkName, String cpName, String qn)
bkName
- a String
valuecpName
- a String
valueqn
- a String
valuepublic static Question getValidQuestion(ChapterData chapDat, AbstractChapter chapt)
chapDat
- a ChapterData
valuechapt
- an AbstractChapter
value
Question
valueChapter
,
ChapterData
public String getQuestionId(String bkName, String cpName)
bkName
- a String
valuecpName
- a String
value
String
valueChapterData.getQuestion()
public void setName(String n)
n
- a String
valuepublic String getName()
String
valuepublic void setPassword(String n)
n
- a String
valuepublic void addBook(BookData b)
b
- a BookData
valuepublic void toXML(Writer writer) throws IOException
writer
- a java.io.Writer
value
IOException
- if an error occurspublic UserFile getUserFile()
UserFile
valuepublic void setUserFile(UserFile f)
f
- an UserFile
valuepublic void save() throws FileNotFoundException, IOException
FileNotFoundException
- if an error occurs
IOException
- if an error occurspublic void save(File directory) throws IOException
directory
- a File
value
IOException
- if an error occursprotected String getBaseFileName()
getBaseFileName
method here.
String
value@Deprecated public ChapterData getChapterData(String bkName, String cpName)
getChapterData
method here.
bkName
- a String
valuecpName
- a String
value
ChapterData
valuepublic ChapterData getChapterData(ChapterReference ref)
getChapterData
method here.
ref
- a ChapterReference
value
ChapterData
valuepublic static void addQuizData(ChapterData who, QuizData qdd)
who
- a ChapterData
valueqdd
- a QuizData
valuepublic static QuizCollectionData getStatistics(ChapterData who)
who
- a ChapterData
value
QuizCollectionData
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |