|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.jsurveyor.Question
net.sourceforge.jsurveyor.QuestionMultipleChoice
Class to model multipechoice questions Besides what is implemented from its superclass it handles the list of possible answers for the multiplechoice question.
| Constructor Summary | |
QuestionMultipleChoice()
Constructor for QuestionMultipleChoice |
|
QuestionMultipleChoice(int questionID,
java.lang.String text,
boolean writeable,
boolean required,
boolean depends,
java.util.ArrayList dependency,
java.lang.String[] choice)
Constructor for QuestionMultipleChoice, use through DataAccess. |
|
QuestionMultipleChoice(java.lang.String text,
boolean writeable)
Constructor for QuestionMultipleChoice |
|
QuestionMultipleChoice(java.lang.String text,
java.lang.String[] choice,
boolean writeable)
Constructor for QuestionMultipleChoice. |
|
| Method Summary | |
void |
addChoice(java.lang.String[] newchoice,
int n)
Adds an array of choices to the existing array of choices, starting from the nth position |
java.lang.String[] |
getChoice()
This method returns the text of the different choices. |
java.util.ArrayList |
getDependency()
Returns the ArrayList representation of dependency |
boolean |
getDepends()
Does the question depend on a specific answer from another question for it to be asked? |
int |
getQuestionID()
Returns the ID of the question. |
java.lang.String |
getText()
Returns the question text. |
boolean |
getWriteable()
Returns true if the question is writeable |
boolean |
isWriteable()
Returns true if the question is writeable. |
void |
removeChoice(int n)
Removes a choice at the nth position from the existing array of choices |
void |
removeDependency()
Removes any dependency on the question. |
void |
setChoice(java.lang.String[] choice)
Sets the text of the different choices. |
void |
setDependency(QuestionMultipleChoice question,
int[] choices)
Sets the dependency of this question to specific answers of a multiplechoice question. |
void |
setQuestionID(int questionID)
Sets the ID of the question. |
void |
setText(java.lang.String text)
Sets the question text. |
void |
setWriteable(boolean writeable)
Sets the writable parameter. |
java.lang.String |
toString()
Returns the questionID prefixed with a M to represent it is a multiplechoice. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public QuestionMultipleChoice()
public QuestionMultipleChoice(java.lang.String text,
boolean writeable)
text - Stringwriteable - boolean
public QuestionMultipleChoice(java.lang.String text,
java.lang.String[] choice,
boolean writeable)
text - Stringchoice - String[]writeable - boolean
public QuestionMultipleChoice(int questionID,
java.lang.String text,
boolean writeable,
boolean required,
boolean depends,
java.util.ArrayList dependency,
java.lang.String[] choice)
questionID - inttext - Stringwriteable - booleanrequired - booleandepends - booleandependency - ArrayListchoice - String[]| Method Detail |
public java.lang.String[] getChoice()
public void setChoice(java.lang.String[] choice)
throws java.lang.IllegalAccessException
choice - String[]
java.lang.IllegalAccessException
public void addChoice(java.lang.String[] newchoice,
int n)
throws java.lang.IllegalAccessException
newchoice - String[]n - int
java.lang.IllegalAccessException - .
public void removeChoice(int n)
throws java.lang.IllegalAccessException
n - int
java.lang.IllegalAccessExceptionpublic java.lang.String toString()
public int getQuestionID()
public void setQuestionID(int questionID)
questionID - intpublic java.lang.String getText()
public void setText(java.lang.String text)
throws java.lang.IllegalAccessException
text - String
java.lang.IllegalAccessExceptionpublic boolean getDepends()
public void setDependency(QuestionMultipleChoice question,
int[] choices)
throws java.lang.IllegalAccessException
question - QuestionMultipleChoicechoices - int[]
java.lang.IllegalAccessException
public void removeDependency()
throws java.lang.IllegalAccessException
java.lang.IllegalAccessExceptionpublic java.util.ArrayList getDependency()
public boolean isWriteable()
public void setWriteable(boolean writeable)
writeable - booleanpublic boolean getWriteable()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||