Class ANumberFilter

java.lang.Object
org.sm.smtools.swing.util.ANumberFilter

public abstract class ANumberFilter extends 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 Details

    • ANumberFilter

      public ANumberFilter()
  • Method Details

    • validateInteger

      public abstract boolean validateInteger(int i)
      Checks whether or not an int 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 - the int value to check
      Returns:
      true when the specified int value is accepted, false otherwise
    • validateDouble

      public abstract boolean validateDouble(double d)
      Checks whether or not a double 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 - the double value to check
      Returns:
      true when the specified double value is accepted, false otherwise