Class TreeQuestion
java.lang.Object
com.sun.interview.Question
com.sun.interview.TreeQuestion
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface that provides the model for the tree whose nodes are selected by a TreeQuestion. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTreeQuestion(Interview interview, String tag, TreeQuestion.Model model) Create a tree question with a nominated tag and tree model. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear any response to this question, resetting the value back to its initial state.String[]Get the default response for this question.getModel()Get the tree model to which the question's path values relate.Get the response to this question as a string.String[]getValue()Get the current (default or latest) response to this question.String[]Verify this question is on the current path, and if it is, return the current value.booleanCheck if the question always has a valid response.booleanCheck if the question currently has a valid response.static Stringprotected voidLoad the value for this question from a dictionary, using the tag as the key.protected voidSave the value for this question in a dictionary, using the tag as the key.voidsetDefaultValue(String... v) Set the default response for this question, used by the clear method.voidSet the current response to this question.voidSet the response to this question to the value represented by a string-valued argument.voidSet the current response to this question.static String[]static booleanwhite(char c) Methods inherited from class 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
-
Field Details
-
value
The current response for this question.
-
-
Constructor Details
-
TreeQuestion
Create a tree question with a nominated tag and tree model.- Parameters:
interview- The interview containing this question.tag- A unique tag to identify this specific question.model- The tree model to which the question's path values relate.
-
-
Method Details
-
split
-
join
-
white
public static boolean white(char c) -
getModel
Get the tree model to which the question's path values relate.- Returns:
- the tree model to which the question's path values relate
-
getDefaultValue
Get the default response for this question.- Returns:
- the default response for this question.
- See Also:
-
setDefaultValue
Set the default response for this question, used by the clear method.- Parameters:
v- the default response for this question.- See Also:
-
getValue
Get the current (default or latest) response to this question. The strings should each represent valid paths to nodes within the tree represented by the tree model.- Returns:
- the current value for this question
- See Also:
-
setValue
Description copied from class:QuestionSet the response to this question to the value represented by a string-valued argument. Subtypes of Question will typically have type-specific methods to set the value as well. -
setValue
Set the current response to this question.- Parameters:
newValue- a set of strings (or null if none), representing paths to nodes within the tree represented by the tree model- See Also:
-
setValue
Set the current response to this question. The response is set to the paths of a set of specified nodes within the tree represented by the tree model.- Parameters:
nodes- a set of nodes (or null if none) within the tree represented by the tree model, whose paths will be set as the current response to the question- See Also:
-
getValueOnPath
Verify this question is on the current path, and if it is, return the current value.- Returns:
- the current value of this question
- Throws:
Interview.NotOnPathFault- if this question is not on the current path- See Also:
-
getStringValue
Description copied from class:QuestionGet the response to this question as a string.- Specified by:
getStringValuein classQuestion- Returns:
- a string representing the current response to this question, or null.
- See Also:
-
isValueValid
public boolean isValueValid()Description copied from class:QuestionCheck if the question currently has a valid response.- Specified by:
isValueValidin classQuestion- Returns:
- true if the question currently has a valid response, and false otherwise.
-
isValueAlwaysValid
public boolean isValueAlwaysValid()Description copied from class:QuestionCheck if the question always has a valid response. This may be true, for example, for a choice question with a default response.- Specified by:
isValueAlwaysValidin classQuestion- Returns:
- true if the question always has a valid response, and false otherwise.
-
clear
-
load
-
save
-