Class StringListQuestion
java.lang.Object
com.sun.interview.Question
com.sun.interview.StringListQuestion
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStringListQuestion(Interview interview, String tag) Create a question with a nominated tag. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear any response to this question, resetting the value back to its initial state.protected static booleanCompare two string arrays for equality.protected static booleanCompare two strings for equality.String[]Get the default response for this question.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 whether or not duplicates should be allowed in the list.booleanCheck if the question always has a valid response.booleanCheck if the question currently has a valid response.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.voidsetDuplicatesAllowed(boolean b) Specify whether or not duplicates should be allowed in the list.voidSet the response to this question to the value represented by a string-valued argument.voidSet the current value.protected static String[]Split a string into a set of newline-separated strings.Methods inherited from class Question
addMarker, equals, export, getChecklistItems, getHelpID, getImage, getInterview, getKey, getNext, getResourceString, getResourceString, getSummary, getTag, getText, getTextArgs, hashCode, hasMarker, isEnabled, isHidden, load, reload, removeMarker, setHelpID, setImage, setImage, setSummary, setText
-
Field Details
-
value
The current response for this question.
-
-
Constructor Details
-
StringListQuestion
-
-
Method Details
-
equal
Compare two string arrays for equality.- Parameters:
s1- the first array to be compared, or nulls2- the other array to be compared, or null- Returns:
- true if both parameters are null, or if both are non-null and are element-wise equal.
- See Also:
-
equal
-
split
-
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:
-
isDuplicatesAllowed
public boolean isDuplicatesAllowed()Check whether or not duplicates should be allowed in the list.- Returns:
- true if duplicates should be allowed, and false otherwise
- See Also:
-
setDuplicatesAllowed
public void setDuplicatesAllowed(boolean b) Specify whether or not duplicates should be allowed in the list. By default, duplicates are allowed.- Parameters:
b- true if duplicates should be allowed, and false otherwise- See Also:
-
getValue
Get the current (default or latest) response to this question.- Returns:
- The current value.
- 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 value.- Parameters:
newValue- The value to be set.- 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
Get 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
-
save
-