Modifier and Type | Field and Description |
---|---|
protected float[] |
suggestions
Suggested values for this question.
|
protected float |
value
The current response for this question.
|
Modifier | Constructor and Description |
---|---|
protected |
FloatQuestion(Interview interview,
java.lang.String tag)
Create a question with a nominated tag.
|
protected |
FloatQuestion(Interview interview,
java.lang.String tag,
float min,
float max,
float resolution)
Create a question with a nominated tag.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear any response to this question, resetting the value
back to its initial state.
|
float |
getDefaultValue()
Get the default response for this question.
|
float |
getLabelIncrementHint()
Get a hint for the rendering system for the increment between
labels.
|
float |
getLabelStartHint()
Get a hint for the rendering system for the lowest value
that might be labelled.
|
float |
getLowerBound()
Get the inclusive lower bound for responses to this question.
|
float |
getResolution()
Get the resolution for responses to this question.
|
java.lang.String |
getStringValue()
Get the response to this question as a string.
|
float[] |
getSuggestions()
Get the suggested responses to this question, or null if none.
|
float |
getUpperBound()
Get the inclusive lower bound for responses to this question.
|
float |
getValue()
Get the current (default or latest) response to this question.
|
float |
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(float min,
float max)
Set the bounds for the response to this question.
|
void |
setDefaultValue(float v)
Set the default response for this question,
used by the clear method.
|
protected void |
setLabelHints(float start,
float increment)
Set hints for the rendering system for the values that might
be labelled.
|
void |
setResolution(float resolution)
Set the resolution for responses to this question.
|
void |
setSuggestions(float[] newSuggestions)
Set the set of suggested responses.
|
void |
setValue(float 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.
|
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
protected float value
protected float[] suggestions
protected FloatQuestion(Interview interview, java.lang.String tag)
interview
- The interview containing this question.tag
- A unique tag to identify this specific question.protected FloatQuestion(Interview interview, java.lang.String tag, float min, float max, float resolution)
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 questionresolution
- The resolution for responses to this question.java.lang.IllegalArgumentException
- if min
is greater than
or equal to max
.protected void setBounds(float min, float max)
min
- The inclusive lower bound for responses to this questionmax
- The inclusive upper bound for responses to this questionjava.lang.IllegalArgumentException
- if min
is greater than
or equal to max
.public float getLowerBound()
public float getUpperBound()
public boolean isValid()
clear()
public void setResolution(float resolution)
resolution
- the resolution for responses to this questiongetResolution()
,
setValue(java.lang.String)
public float getResolution()
setResolution(float)
,
setValue(java.lang.String)
public float[] getSuggestions()
setSuggestions(float[])
public void setSuggestions(float[] newSuggestions)
newSuggestions
- The values to be set, or null if nonegetSuggestions()
public float getDefaultValue()
setDefaultValue(float)
public void setDefaultValue(float v)
v
- the default response for this question.getDefaultValue()
public float getValue()
setValue(java.lang.String)
public float 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()
,
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 parameterInterview.Fault
- This exception is just retained for backwards
compatibility; it should never actually be thrown.getValue()
,
getValue()
,
setValue(String, Locale)
public void setValue(float 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(float start, float increment)
start
- The lowest value to be labelledincrement
- The increment for successive labelspublic float getLabelStartHint()
public float getLabelIncrementHint()
public void clear()
protected void load(java.util.Map data)
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.