|
||||||||||
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.IntQuestion
public abstract class IntQuestion
A question
to which the response is an integer.
Field Summary | |
---|---|
protected int[] |
suggestions
Suggested values for this question. |
protected int |
value
The current response for this question. |
Fields inherited from class com.sun.interview.Question |
---|
interview, key, tag |
Constructor Summary | |
---|---|
protected |
IntQuestion(Interview interview,
java.lang.String tag)
Create a question with a nominated tag. |
protected |
IntQuestion(Interview interview,
java.lang.String tag,
int min,
int max)
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. |
int |
getDefaultValue()
Get the default response for this question. |
int |
getLabelIncrementHint()
Get a hint for the rendering system for the increment between labels. |
int |
getLabelStartHint()
Get a hint for the rendering system for the lowest value that might be labelled. |
int |
getLowerBound()
Get the inclusive lower bound for responses to this question. |
java.lang.String |
getStringValue()
Get the response to this question as a string. |
int[] |
getSuggestions()
Get the suggested responses to this question, or null if none. |
int |
getUpperBound()
Get the inclusive upper bound for responses to this question. |
int |
getValue()
Get the current (default or latest) response to this question. |
int |
getValueOnPath()
Verify this question is on the current path, and if it is, return the current value. |
boolean |
isValid()
Deprecated. see #isValueValid |
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 |
setBounds(int min,
int max)
Set the bounds for the response to this question. |
void |
setDefaultValue(int v)
Set the default response for this question, used by the clear method. |
protected void |
setLabelHints(int start,
int increment)
Set hints for the rendering system for the values that might be labelled. |
void |
setSuggestions(int[] newSuggestions)
Set the set of suggested responses. |
void |
setValue(int newValue)
Set the current value. |
void |
setValue(java.lang.String s)
Set the response to this question to the value represented by a string-valued argument. |
void |
setValue(java.lang.String s,
java.util.Locale l)
Set the response to this question to the value represented by a string-valued argument, given in certain locale. |
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 |
---|
protected int value
protected int[] suggestions
Constructor Detail |
---|
protected IntQuestion(Interview interview, java.lang.String tag)
interview
- The interview containing this question.tag
- A unique tag to identify this specific question.protected IntQuestion(Interview interview, java.lang.String tag, int min, int max)
interview
- The interview containing this question.tag
- A unique tag to identify this specific question.min
- The inclusive lower bound for responses to this questionmax
- The inclusive upper bound for responses to this question
java.lang.IllegalArgumentException
- if min
is greater than
or equal to max
.Method Detail |
---|
protected void setBounds(int min, int max)
min
- The inclusive lower bound for responses to this questionmax
- The inclusive upper bound for responses to this question
java.lang.IllegalArgumentException
- if min
is greater than
or equal to max
.public int getLowerBound()
public int getUpperBound()
public int[] getSuggestions()
setSuggestions(int[])
public void setSuggestions(int[] newSuggestions)
newSuggestions
- The values to be set, or null if nonegetSuggestions()
public int getDefaultValue()
setDefaultValue(int)
public void setDefaultValue(int v)
v
- the default response for this question.getDefaultValue()
public boolean isValid()
Integer.MIN_VALUE
.
clear()
public int getValue()
Integer.MIN_VALUE
.
isValid()
,
setValue(java.lang.String)
public int getValueOnPath() throws Interview.NotOnPathFault
Interview.NotOnPathFault
- if this question is not on the
current pathgetValue()
public java.lang.String getStringValue()
Question
getStringValue
in class Question
Question.setValue(String)
public void setValue(java.lang.String s) throws Interview.Fault
setValue
in class Question
s
- A string containing the numeric value to be set.
The number should be in the range of valid values defined for
this question; if it is not, the value will be retained,
but isValueValid() will return false.
Interview.Fault
- This exception is just retained for backwards
compatibility; it should never actually be thrown.getValue()
,
setValue(String, Locale)
public void setValue(java.lang.String s, java.util.Locale l) throws Interview.Fault
s
- A string containing the numeric value to be set.
The number should be in the range of valid values defined for
this question; if it is not, the value will be retained,
but isValueValid() will return false.l
- A locale that should be used to decode numeric value
from given string parameter
Interview.Fault
- This exception is just retained for backwards
compatibility; it should never actually be thrown.getValue()
,
setValue(String)
public void setValue(int newValue)
newValue
- The value to be set. It should be in the range
of valid values defined for this question.getValue()
public boolean isValueValid()
Question
isValueValid
in class Question
public boolean isValueAlwaysValid()
Question
isValueAlwaysValid
in class Question
protected void setLabelHints(int start, int increment)
start
- The lowest value to be labelledincrement
- The increment for successive labelspublic int getLabelStartHint()
public int getLabelIncrementHint()
public void clear()
clear
in class Question
protected void load(java.util.Map data)
load
in class Question
data
- The map from which to load the value for this question.protected void save(java.util.Map data)
save
in class Question
data
- 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 |