Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.questionnaire.bean
Class ManyInManyStringsQuestion  view ManyInManyStringsQuestion download ManyInManyStringsQuestion.java

java.lang.Object
  extended bycom.RuntimeCollective.questionnaire.bean.SimpleQuestion
      extended bycom.RuntimeCollective.questionnaire.bean.XInManyStringsQuestion
          extended bycom.RuntimeCollective.questionnaire.bean.ManyInManyStringsQuestion
All Implemented Interfaces:
com.RuntimeCollective.webapps.bean.EntityBean, Question, java.io.Serializable

public class ManyInManyStringsQuestion
extends XInManyStringsQuestion

Question implementation which offers the choice of many Strings between many.

Useful for multi-choice questionnaires, where more than one answer of many can be chosen.

Version:
$Id: ManyInManyStringsQuestion.java,v 1.4 2003/09/30 15:12:53 joe Exp $

Field Summary
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
 
Fields inherited from class com.RuntimeCollective.questionnaire.bean.XInManyStringsQuestion
CHOICES_TABLE, DATABASE_ID, DATABASE_KEY, DisplayTexts, Keys, REAL_DATABASE_TABLE
 
Fields inherited from class com.RuntimeCollective.questionnaire.bean.SimpleQuestion
Description, id, Name, QuestionnaireId
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Constructor Summary
ManyInManyStringsQuestion()
          Construct a new blank ManyInManyStringsQuestion, giving it a new unique ID.
ManyInManyStringsQuestion(int id)
          Get a current ManyInManyStringsQuestion from the RuntimeDataSource, given an id.
 
Method Summary
 boolean isAnswerValid(java.lang.Object answer)
          Check the validity of a raw Object answer for this Question.
 Answer makeNewAnswer(java.lang.Object answer)
          Make a new Answer to this Question, based on a row answer Object.
protected  void setDatabaseParticulars()
          Fill in details of the database tables used by this class
 
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 com.RuntimeCollective.questionnaire.bean.SimpleQuestion
getDescription, getId, getName, getQuestionnaire, setDescription, setId, setName, setQuestionnaire
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ManyInManyStringsQuestion

public ManyInManyStringsQuestion()
Construct a new blank ManyInManyStringsQuestion, giving it a new unique ID.


ManyInManyStringsQuestion

public ManyInManyStringsQuestion(int id)
Get a current ManyInManyStringsQuestion from the RuntimeDataSource, given an id.

Method Detail

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 Collection of Strings), and then creates a new ManyStringAnswer.

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 a Collection of Strings, each one being one of the possible String choices.

Specified by:
isAnswerValid in interface Question
Specified by:
isAnswerValid in class XInManyStringsQuestion