Package org.apache.pivot.wtk.validation
Class IntRangeValidator
- java.lang.Object
-
- org.apache.pivot.wtk.validation.FormattedValidator<java.text.NumberFormat>
-
- org.apache.pivot.wtk.validation.DecimalValidator
-
- org.apache.pivot.wtk.validation.IntValidator
-
- org.apache.pivot.wtk.validation.IntRangeValidator
-
- All Implemented Interfaces:
Validator
public class IntRangeValidator extends IntValidator
A validator for anint
value limited to a range.BigInteger
math is used here so that proper checks against the limits of the type can be done.- See Also:
ComparableRangeValidator
-
-
Field Summary
-
Fields inherited from class org.apache.pivot.wtk.validation.FormattedValidator
format, locale
-
-
Constructor Summary
Constructors Constructor Description IntRangeValidator()
IntRangeValidator(int minValue, int maxValue)
IntRangeValidator(java.util.Locale locale)
IntRangeValidator(java.util.Locale locale, int minValue, int maxValue)
IntRangeValidator(java.util.Locale locale, Limits limits)
IntRangeValidator(Limits limits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaximum()
int
getMinimum()
boolean
isValid(java.lang.String text)
Determines if a text value is valid based on the rules of the validator.void
setLimits(Limits limits)
void
setMaximum(int maxValue)
void
setMinimum(int minValue)
-
Methods inherited from class org.apache.pivot.wtk.validation.DecimalValidator
isAutoTrim, parseNumber, setAutoTrim, textToBigDecimal
-
-
-
-
Constructor Detail
-
IntRangeValidator
public IntRangeValidator()
-
IntRangeValidator
public IntRangeValidator(java.util.Locale locale)
-
IntRangeValidator
public IntRangeValidator(int minValue, int maxValue)
-
IntRangeValidator
public IntRangeValidator(java.util.Locale locale, int minValue, int maxValue)
-
IntRangeValidator
public IntRangeValidator(Limits limits)
-
IntRangeValidator
public IntRangeValidator(java.util.Locale locale, Limits limits)
-
-
Method Detail
-
getMinimum
public int getMinimum()
-
setMinimum
public void setMinimum(int minValue)
-
getMaximum
public int getMaximum()
-
setMaximum
public void setMaximum(int maxValue)
-
setLimits
public void setLimits(Limits limits)
-
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.
-
-