java.lang.Object
com.RuntimeCollective.questionnaire.bean.SimpleQuestion
com.RuntimeCollective.questionnaire.bean.XInManyStringsQuestion
com.RuntimeCollective.questionnaire.bean.OneInManyStringsQuestion
- All Implemented Interfaces:
- com.RuntimeCollective.webapps.bean.EntityBean, Question, java.io.Serializable
- public class OneInManyStringsQuestion
- extends XInManyStringsQuestion
Question implementation which offers the choice of one String between many.
Useful for single-option questionnaires, where only one answer of many can be chosen.
- Version:
- $Id: OneInManyStringsQuestion.java,v 1.13 2003/09/30 15:12:53 joe Exp $
| Methods inherited from class com.RuntimeCollective.questionnaire.bean.XInManyStringsQuestion |
addChoice, addChoice, delete, getDisplayText, getDisplayTexts, getIndexOfKey, getKey, getKeys, isNewChoiceValid, removeChoice, removeChoiceIfNoVotes, save, setDisplayText, setKey |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATABASE_TABLE
public static final java.lang.String DATABASE_TABLE
- The name of the database table for this bean type.
- See Also:
- Constant Field Values
OneInManyStringsQuestion
public OneInManyStringsQuestion()
- Construct a new blank OneInManyStringsQuestion, giving it a new unique ID.
OneInManyStringsQuestion
public OneInManyStringsQuestion(int id)
- Get a current OneInManyStringsQuestion from the RuntimeDataSource, given an id.
setDatabaseParticulars
protected void setDatabaseParticulars()
- Fill in details of the database tables used by this class
- Specified by:
setDatabaseParticulars in class XInManyStringsQuestion
makeNewAnswer
public Answer makeNewAnswer(java.lang.Object answer)
throws com.RuntimeCollective.questionnaire.InvalidAnswerException
- Make a new Answer to this Question, based on a row answer Object.
This checks the validity of the raw Object answer (which must be
a String), and then creates a new OneStringAnswer.
- Specified by:
makeNewAnswer in interface Question- Specified by:
makeNewAnswer in class XInManyStringsQuestion
isAnswerValid
public boolean isAnswerValid(java.lang.Object answer)
- Check the validity of a raw Object answer for this Question.
It should be one of the possible String choices.
- Specified by:
isAnswerValid in interface Question- Specified by:
isAnswerValid in class XInManyStringsQuestion