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 a double value is valid.
    abstract boolean validateInteger​(int i)
    Checks whether or not an int 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 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