Package org.apache.pivot.wtk.validation
Class FloatRangeValidator
- java.lang.Object
-
- org.apache.pivot.wtk.validation.FormattedValidator<java.text.NumberFormat>
-
- org.apache.pivot.wtk.validation.DecimalValidator
-
- org.apache.pivot.wtk.validation.FloatValidator
-
- org.apache.pivot.wtk.validation.FloatRangeValidator
-
- All Implemented Interfaces:
Validator
public class FloatRangeValidator extends FloatValidator
A validator for a float value limited to a range.Beware that usual math rules for native primitive types (and related approximations) are applied here.
- See Also:
ComparableRangeValidator
-
-
Field Summary
-
Fields inherited from class org.apache.pivot.wtk.validation.FormattedValidator
format, locale
-
-
Constructor Summary
Constructors Constructor Description FloatRangeValidator()
FloatRangeValidator(float minValue, float maxValue)
FloatRangeValidator(java.util.Locale locale)
FloatRangeValidator(java.util.Locale locale, float minValue, float maxValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getMaximum()
float
getMinimum()
boolean
isValid(java.lang.String text)
Determines if a text value is valid based on the rules of the validator.void
setMaximum(float maxValue)
void
setMinimum(float minValue)
-
Methods inherited from class org.apache.pivot.wtk.validation.DecimalValidator
isAutoTrim, parseNumber, setAutoTrim, textToBigDecimal
-
-
-
-
Constructor Detail
-
FloatRangeValidator
public FloatRangeValidator()
-
FloatRangeValidator
public FloatRangeValidator(java.util.Locale locale)
-
FloatRangeValidator
public FloatRangeValidator(float minValue, float maxValue)
-
FloatRangeValidator
public FloatRangeValidator(java.util.Locale locale, float minValue, float maxValue)
-
-
Method Detail
-
getMinimum
public float getMinimum()
-
setMinimum
public void setMinimum(float minValue)
-
getMaximum
public float getMaximum()
-
setMaximum
public void setMaximum(float maxValue)
-
isValid
public boolean isValid(java.lang.String text)
Description copied from interface:Validator
Determines if a text value is valid based on the rules of the validator.- Specified by:
isValid
in interfaceValidator
- Overrides:
isValid
in classFloatValidator
- Parameters:
text
- The text to test.- Returns:
true
if the value is valid;false
, otherwise.
-
-