com.sun.interview
Class YesNoQuestion

java.lang.Object
  extended by com.sun.interview.Question
      extended by com.sun.interview.ChoiceQuestion
          extended by com.sun.interview.YesNoQuestion

public abstract class YesNoQuestion
extends ChoiceQuestion

A question to which the response is yes or no.


Field Summary
static java.lang.String NO
          A value for a negative response.
static java.lang.String YES
          A value for an affirmative response.
 
Fields inherited from class com.sun.interview.ChoiceQuestion
value
 
Fields inherited from class com.sun.interview.Question
interview, key, tag
 
Constructor Summary
protected YesNoQuestion(Interview interview, java.lang.String tag)
          Create a question with a nominated tag.
protected YesNoQuestion(Interview interview, java.lang.String tag, java.lang.String defaultValue)
          Create a question with a nominated tag.
 
Method Summary
protected  void setChoices(java.lang.String[] choices)
          Set the set of legal responses for this question.
 
Methods inherited from class com.sun.interview.ChoiceQuestion
clear, getChoices, getDefaultValue, getDisplayChoices, getDisplayValue, getStringValue, getValue, getValueOnPath, isValueAlwaysValid, isValueValid, load, save, setChoices, setChoices, setDefaultValue, setI18NChoices, setValue
 
Methods inherited from class com.sun.interview.Question
addMarker, equals, export, getChecklistItems, getHelpID, getImage, getInterview, getKey, getNext, getResourceString, getResourceString, getSummary, getTag, getText, getTextArgs, hashCode, hasMarker, isEnabled, isHidden, reload, removeMarker, setImage, setImage, setSummary, setText
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YES

public static final java.lang.String YES
A value for an affirmative response.

See Also:
Constant Field Values

NO

public static final java.lang.String NO
A value for a negative response.

See Also:
Constant Field Values
Constructor Detail

YesNoQuestion

protected YesNoQuestion(Interview interview,
                        java.lang.String tag)
Create a question with a nominated tag. If this constructor is used, the choices must be supplied separately.

Parameters:
interview - The interview containing this question.
tag - A unique tag to identify this specific question.

YesNoQuestion

protected YesNoQuestion(Interview interview,
                        java.lang.String tag,
                        java.lang.String defaultValue)
Create a question with a nominated tag. If this constructor is used, the choices must be supplied separately.

Parameters:
interview - The interview containing this question.
tag - A unique tag to identify this specific question.
defaultValue - A default value for the question; this must be one of null, YES, or NO.
Method Detail

setChoices

protected final void setChoices(java.lang.String[] choices)
Set the set of legal responses for this question. This is not permitted, since the choices are fixed as YES and NO.

Overrides:
setChoices in class ChoiceQuestion
Parameters:
choices - The set possible responses for this question.
Throws:
java.lang.IllegalArgumentException - always.
See Also:
ChoiceQuestion.getChoices(), ChoiceQuestion.setChoices(String[], boolean), ChoiceQuestion.setChoices(String[], String[])


Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.