Class IntSyntaxChecker


  • public class IntSyntaxChecker
    extends SyntaxChecker
    Accepts integers, possibly restricted to a given range.
    • Constructor Summary

      Constructors 
      Constructor Description
      IntSyntaxChecker()
      Constructs a syntax checker which accepts all strings representing an integer.
      IntSyntaxChecker​(int lowerBound, int upperBound)
      Constructs a syntax checker which accepts all strings representing an integer in the range [lowerBound, upperBound].
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SyntaxChecker.Result check​(java.lang.String input)
      Performs a syntax check on the given string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntSyntaxChecker

        public IntSyntaxChecker()
        Constructs a syntax checker which accepts all strings representing an integer. Rejects strings representing integers that would cause an overflow for the int datatype.
      • IntSyntaxChecker

        public IntSyntaxChecker​(int lowerBound,
                                int upperBound)
        Constructs a syntax checker which accepts all strings representing an integer in the range [lowerBound, upperBound].
        Parameters:
        lowerBound - The smallest acceptable value.
        upperBound - The largest acceptable value.
    • Method Detail

      • check

        public SyntaxChecker.Result check​(java.lang.String input)
        Description copied from class: SyntaxChecker
        Performs a syntax check on the given string.
        Specified by:
        check in class SyntaxChecker
        Parameters:
        input - The string to check.
        Returns:
        The result of syntax checking the given string.