public static class PropertiesQuestion.FloatConstraints extends PropertiesQuestion.ValueConstraints
Modifier and Type | Field and Description |
---|---|
protected boolean |
custom
Is the user allowed to supply their own value or are they required
to use one of the suggestions?
|
protected float[] |
suggestions
Current value set for the suggested response values.
|
Constructor and Description |
---|
FloatConstraints() |
FloatConstraints(float[] suggestions)
Construct with suggestions for the user.
|
FloatConstraints(float min,
float max) |
FloatConstraints(float min,
float max,
float[] suggestions)
Construct with both min, max and suggested values.
|
Modifier and Type | Method and Description |
---|---|
float |
getLowerBound()
Get the lower bound which specifies the minimum possible value to be
considered a valid response from the user.
|
float |
getResolution()
Get the resolution for responses to this question.
|
float[] |
getSuggestions()
Get the suggested values.
|
float |
getUpperBound()
Get the upper bound which specifies the maximum possible value to be
considered a valid response from the user.
|
boolean |
isCustomValuesAllowed()
Are custom user values allowed?
|
java.lang.String |
isValid(float v)
Is the given value valid for this field?
|
java.lang.String |
isValid(java.lang.String v)
Is the given value valid for this field? The basic check for
validity is to see if the given string can be parsed as an
floating point value in the current locale.
|
void |
setBounds(float min,
float max)
Set the max/min possible value that should be considered
valid.
|
void |
setCustomValuesAllowed(boolean state)
Are user specified values allowed? If not, there must be
suggestions present.
|
void |
setResolution(float resolution)
Set the resolution for responses to this question.
|
void |
setSuggestions(float[] sugs)
Supply some possible values that the user may want to
select from.
|
isReadOnly, isUnsetAllowed, isVisible, setReadOnly, setUnsetAllowed, setVisible
protected float[] suggestions
setSuggestions(float[])
,
getSuggestions()
protected boolean custom
public FloatConstraints()
public FloatConstraints(float min, float max)
min
- Minimum valid response value.max
- Maximum valid response valuesetBounds(float, float)
public FloatConstraints(float[] suggestions)
suggestions
- Values to suggest to the user. Array should be
of length greater than zero.public FloatConstraints(float min, float max, float[] suggestions)
min
- Minimum valid response value.max
- Maximum valid response valuesuggestions
- Values to suggest to the user. Array should be
of length greater than zero.getSuggestions()
public void setBounds(float min, float max)
min
- Minimum valid response value.max
- Maximum valid response value.public float getLowerBound()
public float getUpperBound()
public float[] getSuggestions()
setSuggestions(float[])
public void setCustomValuesAllowed(boolean state)
java.lang.IllegalStateException
- If no suggestions have been
provided.setSuggestions(float[])
public boolean isCustomValuesAllowed()
public void setSuggestions(float[] sugs)
sugs
- Suggested values to present the user for this question.
Should be an array of length greater than zero.getSuggestions()
public void setResolution(float resolution)
resolution
- the resolution for responses to this questiongetResolution()
,
PropertiesQuestion.setValue(java.lang.String)
public float getResolution()
setResolution(float)
,
PropertiesQuestion.setValue(java.lang.String)
public java.lang.String isValid(java.lang.String v)
isValid
in class PropertiesQuestion.ValueConstraints
v
- The value to check.PropertiesQuestion.getInvalidKeys()
public java.lang.String isValid(float v)
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.