Package org.sm.smtools.swing.util
Class ANumberFilter
java.lang.Object
org.sm.smtools.swing.util.ANumberFilter
public abstract class ANumberFilter
extends java.lang.Object
The
NumberFilter
class provides methods to validate the input in a JNumberInputField
.
Note that this is an abstract class.
- Version:
- 05/09/2014
- Author:
- Sven Maerivoet
-
Constructor Summary
Constructors Constructor Description ANumberFilter()
-
Method Summary
Modifier and Type Method Description abstract boolean
validateDouble(double d)
Checks whether or not adouble
value is valid.abstract boolean
validateInteger(int i)
Checks whether or not anint
value is valid.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ANumberFilter
public ANumberFilter()
-
-
Method Details
-
validateInteger
public abstract boolean validateInteger(int i)Checks whether or not anint
value is valid.A subclass must override this method, thereby specifying its own acceptable range for the
int
value. For example, to accept only strictly positive numbers, the following code can be used:return (i > 0);
- Parameters:
i
- theint
value to check- Returns:
true
when the specifiedint
value is accepted,false
otherwise
-
validateDouble
public abstract boolean validateDouble(double d)Checks whether or not adouble
value is valid.A subclass must override this method, thereby specifying its own acceptable range for the
double
value. For example, to accept only strictly positive numbers, the following code can be used:return (d > 0.0);
- Parameters:
d
- thedouble
value to check- Returns:
true
when the specifieddouble
value is accepted,false
otherwise
-