Package org.apache.pivot.wtk.validation
Class DoubleRangeValidator
- java.lang.Object
-
- org.apache.pivot.wtk.validation.FormattedValidator<java.text.NumberFormat>
-
- org.apache.pivot.wtk.validation.DecimalValidator
-
- org.apache.pivot.wtk.validation.DoubleValidator
-
- org.apache.pivot.wtk.validation.DoubleRangeValidator
-
- All Implemented Interfaces:
Validator
public class DoubleRangeValidator extends DoubleValidator
A validator for a double 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 DoubleRangeValidator()
DoubleRangeValidator(double minValue, double maxValue)
DoubleRangeValidator(java.util.Locale locale)
DoubleRangeValidator(java.util.Locale locale, double minValue, double maxValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaximum()
double
getMinimum()
boolean
isValid(java.lang.String text)
Determines if a text value is valid based on the rules of the validator.void
setMaximum(double maxValue)
void
setMinimum(double minValue)
-
Methods inherited from class org.apache.pivot.wtk.validation.DecimalValidator
isAutoTrim, parseNumber, setAutoTrim, textToBigDecimal
-
-
-
-
Constructor Detail
-
DoubleRangeValidator
public DoubleRangeValidator()
-
DoubleRangeValidator
public DoubleRangeValidator(java.util.Locale locale)
-
DoubleRangeValidator
public DoubleRangeValidator(double minValue, double maxValue)
-
DoubleRangeValidator
public DoubleRangeValidator(java.util.Locale locale, double minValue, double maxValue)
-
-
Method Detail
-
getMinimum
public double getMinimum()
-
setMinimum
public void setMinimum(double minValue)
-
getMaximum
public double getMaximum()
-
setMaximum
public void setMaximum(double 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 classFormattedValidator<java.text.NumberFormat>
- Parameters:
text
- The text to test.- Returns:
true
if the value is valid;false
, otherwise.
-
-