com.isti.util.gui.textvalidator
Class TextNumberValidator

java.lang.Object
  extended by com.isti.util.gui.textvalidator.TextBasicValidator
      extended by com.isti.util.gui.textvalidator.TextMinMaxValidator
          extended by com.isti.util.gui.textvalidator.TextNumberValidator
All Implemented Interfaces:
AllowedCharactersConstants, TextValidator, StringConstants

public class TextNumberValidator
extends TextMinMaxValidator

Class TextNumberValidator defines methods to validate number text.


Field Summary
 
Fields inherited from interface com.isti.util.StringConstants
ALPHA_CAP_CHARS, ALPHA_CHARS, ALPHA_LOW_CHARS, ALPHANUM_CHARS_STRING, ALPHANUMERIC_CHARS, BOOLEAN_FALSE_TEXT, BOOLEAN_TRUE_TEXT, DATE_FORMAT_AMPM_STR, DATE_FORMAT_RFC_822_STR, DATE_FORMAT24_STR, DEFAULT_JAVA_VERSION_STRING, DEFAULT_NULL_STR, DEFAULT_SEP_STR, EFLOAT_CHARS, EMPTY_STRING, FLOAT_CHARS, HEX_ALPHA_CAP_CHARS, HEX_ALPHA_LOW_CHARS, HEX_CHARS, INTEGER_CHARS, INVALID_FILENAME_CHARS, QUOTE_STRING, SIGNED_EFLOAT_CHARS, SIGNED_FLOAT_CHARS, SIGNED_INT_CHARS, SPACE_STRING, TOD_CHARS, WHITE_SPACE_CHARS, WILDCARD_ALL_CHAR, WILDCARD_CHARS, WILDCARD_SINGLE_CHAR
 
Constructor Summary
TextNumberValidator(boolean isFloatFlag, boolean isSignedFlag, int numColumns)
          Creates the number validator.
TextNumberValidator(java.lang.Comparable minNumber, java.lang.Comparable maxNumber, int numColumns)
          Creates the number validator.
TextNumberValidator(double minNumber, double maxNumber, int numColumns)
          Creates the number validator.
TextNumberValidator(long minNumber, long maxNumber, int numColumns)
          Creates the number validator.
TextNumberValidator(java.lang.String allowedChars, int numColumns, java.lang.Comparable min, java.lang.Comparable max)
          Creates the number validator.
 
Method Summary
static java.lang.String getAllowedNumberChars(boolean isFloatFlag, boolean isSignedFlag)
          Gets the allowed number characters.
static java.lang.String getAllowedNumberChars(java.lang.Comparable minNumber, java.lang.Comparable maxNumber)
          Gets the allowed number characters.
static boolean isFloat(java.lang.Comparable n)
          Determines if the number can be a floating point value.
static boolean isFloat(java.lang.Comparable minNumber, java.lang.Comparable maxNumber)
          Determines if the number can be a floating point value.
static boolean isSigned(java.lang.Comparable n)
          Determines if the number can be a signed value.
static boolean isSigned(java.lang.Comparable minNumber, java.lang.Comparable maxNumber)
          Determines if the number can be a signed value.
 
Methods inherited from class com.isti.util.gui.textvalidator.TextMinMaxValidator
getToolTipText, isValid, isValidEntry
 
Methods inherited from class com.isti.util.gui.textvalidator.TextBasicValidator
getAllowedFlag, getColumns, getMaxNumChars, getSpecialChars, getToolTipText, isNumeric, setAllowedFlag, setColumns, setMaxNumChars, setMaxTextLength, setNumericFlag, setSpecialChars, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextNumberValidator

public TextNumberValidator(boolean isFloatFlag,
                           boolean isSignedFlag,
                           int numColumns)
Creates the number validator.

Parameters:
isFloatFlag - true if floating point number.
isSignedFlag - true if signed number.
numColumns - the number of columns or -1 for the default.

TextNumberValidator

public TextNumberValidator(java.lang.Comparable minNumber,
                           java.lang.Comparable maxNumber,
                           int numColumns)
Creates the number validator.

Parameters:
minNumber - the minimum Number value or null if none. The minimum Number value should be an instance of the 'Number' class.
maxNumber - the maximum Number value or null if none. The maximum Number value should be an instance of the 'Number' class.
numColumns - the number of columns or -1 for the default.

TextNumberValidator

public TextNumberValidator(double minNumber,
                           double maxNumber,
                           int numColumns)
Creates the number validator.

Parameters:
minNumber - the minimum value.
maxNumber - the maximum value.
numColumns - the number of columns or -1 for the default.

TextNumberValidator

public TextNumberValidator(long minNumber,
                           long maxNumber,
                           int numColumns)
Creates the number validator.

Parameters:
minNumber - the minimum value.
maxNumber - the maximum value.
numColumns - the number of columns or -1 for the default.

TextNumberValidator

public TextNumberValidator(java.lang.String allowedChars,
                           int numColumns,
                           java.lang.Comparable min,
                           java.lang.Comparable max)
Creates the number validator.

Parameters:
allowedChars - the allowed characters or null for all.
numColumns - the number of columns or -1 for the default.
min - the minimum value or null if none.
max - the maximum value or null if none.
Method Detail

getAllowedNumberChars

public static final java.lang.String getAllowedNumberChars(boolean isFloatFlag,
                                                           boolean isSignedFlag)
Gets the allowed number characters.

Parameters:
isFloatFlag - true if floating point number.
isSignedFlag - true if signed number.
Returns:
the allowed number characters.

getAllowedNumberChars

public static final java.lang.String getAllowedNumberChars(java.lang.Comparable minNumber,
                                                           java.lang.Comparable maxNumber)
Gets the allowed number characters.

Parameters:
minNumber - the minimum Number value or null if none. The minimum Number value should be an instance of the 'Number' class.
maxNumber - the maximum Number value or null if none. The maximum Number value should be an instance of the 'Number' class.
Returns:
the allowed number characters.

isFloat

public static final boolean isFloat(java.lang.Comparable minNumber,
                                    java.lang.Comparable maxNumber)
Determines if the number can be a floating point value.

Parameters:
minNumber - the minimum Number value or null if none. The minimum Number value should be an instance of the 'Number' class.
maxNumber - the maximum Number value or null if none. The maximum Number value should be an instance of the 'Number' class.
Returns:
true if the number can be a floating point value, false otherwise.

isFloat

public static final boolean isFloat(java.lang.Comparable n)
Determines if the number can be a floating point value.

Parameters:
n - the Number value or null if none. The Number value should be an instance of the 'Number' class.
Returns:
true if the number can be a floating point value, false otherwise.

isSigned

public static final boolean isSigned(java.lang.Comparable minNumber,
                                     java.lang.Comparable maxNumber)
Determines if the number can be a signed value.

Parameters:
minNumber - the minimum Number value or null if none. The minimum Number value should be an instance of the 'Number' class.
maxNumber - the maximum Number value or null if none. The maximum Number value should be an instance of the 'Number' class.
Returns:
true if the number can be a signed value, false otherwise.

isSigned

public static final boolean isSigned(java.lang.Comparable n)
Determines if the number can be a signed value.

Parameters:
n - the Number value or null if none. The Number value should be an instance of the 'Number' class.
Returns:
true if the number can be a signed value, false otherwise.