|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.interview.Question
com.sun.interview.ChoiceArrayQuestion
public abstract class ChoiceArrayQuestion
A question to which the response is one of a number of choices.
| Field Summary | |
|---|---|
protected boolean[] |
value
The current (default or latest) response to this question. |
| Fields inherited from class com.sun.interview.Question |
|---|
interview, key, tag |
| Constructor Summary | |
|---|---|
protected |
ChoiceArrayQuestion(Interview interview,
java.lang.String tag)
Create a question with a nominated tag. |
protected |
ChoiceArrayQuestion(Interview interview,
java.lang.String tag,
java.lang.String[] choices)
Create a question with a nominated tag. |
| Method Summary | |
|---|---|
void |
clear()
Clear any response to this question, resetting the value back to its initial state. |
java.lang.String[] |
getChoices()
Get the set of legal responses for this question. |
boolean[] |
getDefaultValue()
Get the default response for this question. |
java.lang.String[] |
getDisplayChoices()
Get the display values for the set of choices for this question. |
java.lang.String |
getStringValue()
Get the response to this question as a string. |
boolean[] |
getValue()
Get the current (default or latest) response to this question. |
boolean[] |
getValueOnPath()
Verify this question is on the current path, and if it is, return the current value. |
boolean |
isValueAlwaysValid()
Check if the question always has a valid response. |
boolean |
isValueValid()
Check if the question currently has a valid response. |
protected void |
load(java.util.Map data)
Load the value for this question from a dictionary, using the tag as the key. |
protected void |
save(java.util.Map data)
Save the value for this question in a dictionary, using the tag as the key. |
protected void |
setChoices(java.lang.String[] choices)
Set the names of the choices for this question. |
protected void |
setChoices(java.lang.String[] choices,
boolean localize)
Set the names of the choices for this question. |
protected void |
setChoices(java.lang.String[] choices,
java.lang.String[] displayChoices)
Set the names of the choices for this question. |
void |
setDefaultValue(boolean[] v)
Set the default response for this question, used by the clear method. |
void |
setValue(boolean[] newValue)
Set the current value. |
void |
setValue(java.lang.String newValue)
Set the current value. |
| 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, setHelpID, setImage, setImage, setSummary, setText |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean[] value
| Constructor Detail |
|---|
protected ChoiceArrayQuestion(Interview interview,
java.lang.String tag)
interview - The interview containing this question.tag - A unique tag to identify this specific question.
protected ChoiceArrayQuestion(Interview interview,
java.lang.String tag,
java.lang.String[] choices)
interview - The interview containing this question.tag - A unique tag to identify this specific question.choices - The names of the choices, which can each be selected (true)
or not (false).
java.lang.NullPointerException - if choices is null| Method Detail |
|---|
protected void setChoices(java.lang.String[] choices)
choices - The set of names for the choices for this question.
java.lang.NullPointerException - if choices is nullgetChoices(),
getDisplayChoices()
protected void setChoices(java.lang.String[] choices,
boolean localize)
choices - The set of names of the choices for this question.localize - if false, the choices will be used directly
as the display choices; otherwise the choices will be used
to construct keys to get localized values from the interview's
resource bundle.
java.lang.NullPointerException - if choices is nullgetChoices(),
getDisplayChoices()
protected void setChoices(java.lang.String[] choices,
java.lang.String[] displayChoices)
choices - The set of names of the choices for this question.displayChoices - An array of strings to be presented to
the user that identify the choices for this question.
The value can also be null, to indicate that the display choices
should be determined automatically by obtaining localized values
for the entries in the choices array.
java.lang.NullPointerException - if choices is null.
java.lang.IllegalArgumentException - if displayChoices is not null
and is a different length than choices.getChoices(),
getDisplayChoices()public java.lang.String[] getChoices()
setChoices(java.lang.String[])public java.lang.String[] getDisplayChoices()
setChoices(java.lang.String[]),
getDisplayChoices()public boolean[] getDefaultValue()
setDefaultValue(boolean[])public void setDefaultValue(boolean[] v)
v - the default response for this question.getDefaultValue()public boolean[] getValue()
java.lang.IllegalStateException - if no choices have been set, defining
the set of responses to this questionsetValue(java.lang.String),
setChoices(java.lang.String[])
public boolean[] getValueOnPath()
throws Interview.NotOnPathFault
Interview.NotOnPathFault - if this question is not on the
current pathgetValue()public java.lang.String getStringValue()
Question
getStringValue in class QuestionQuestion.setValue(String)public void setValue(java.lang.String newValue)
setValue in class QuestionnewValue - The value to be set. The value is broken into words,
and each word must identify one of the set of choices for this question.
The set of choices so identified will be set to true.
Invalid choices are ignored.getValue()public boolean isValueValid()
Question
isValueValid in class Questionpublic boolean isValueAlwaysValid()
Question
isValueAlwaysValid in class Questionpublic void setValue(boolean[] newValue)
newValue - The new value: one boolean per choice, indicating whether
the corresponding choice is selected or not.getValue()public void clear()
clear in class Questionprotected void load(java.util.Map data)
load in class Questiondata - The map from which to load the value for this question.protected void save(java.util.Map data)
save in class Questiondata - The map in which to save the value for this question.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||