org.jsurveylib.model.question
Class OneChoiceQuestion

java.lang.Object
  extended by org.jsurveylib.model.question.Question
      extended by org.jsurveylib.model.question.OneChoiceQuestion
All Implemented Interfaces:
Template, SurveyElement, Visitable
Direct Known Subclasses:
CheckboxQuestion, DropdownQuestion, RadioButtonsQuestion

public abstract class OneChoiceQuestion
extends Question

FOR INTERNAL USE ONLY.

Copyright (c)2007, Daniel Kaplan

Since:
7.10.30
Author:
Daniel Kaplan

Method Summary
 java.lang.String getAnswer()
          The answer of this question.
 java.util.List<Choice> getChoices()
          Return an unmodifiable list of Choices
 int getSelectedIndex()
           
 void setAnswer(java.lang.String value)
          Sets the answer of this question.
 
Methods inherited from class org.jsurveylib.model.question.Question
addAnswerListener, addEnableListener, addValidationListener, addVisibilityListener, fireAnswerChanged, fireAnswerChanged, getCurrentValidationMessage, getId, getLabel, getOnAnswerChanged, isAnswerable, isAnswered, isEnabled, isMandatory, isValid, isVisible, populateTemplate, removeAnswerListener, removeEnableListener, removeValidationListener, removeVisibilityListener, setEnabled, setLabel, setLabel, setMandatory, setOnAnswerChanged, setValid, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jsurveylib.model.Visitable
accept
 

Method Detail

getChoices

public java.util.List<Choice> getChoices()
Return an unmodifiable list of Choices

Returns:
an unmodifiable list of Choice objects

setAnswer

public void setAnswer(java.lang.String value)
Description copied from class: Question
Sets the answer of this question. If null is passed in, getAnswer() should return "" instead of null.

Specified by:
setAnswer in class Question
Parameters:
value - The answer or "" if there is no answer. This should never return null.

getAnswer

public java.lang.String getAnswer()
Description copied from class: Question
The answer of this question. This should never return null, it should return "" instead.

Specified by:
getAnswer in class Question
Returns:
The answer to the question or "" if there is no answer.

getSelectedIndex

public int getSelectedIndex()