Class DoubleSyntaxChecker


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

      Constructors 
      Constructor Description
      DoubleSyntaxChecker()
      Constructs a syntax checker which accepts all strings representing an integer.
      DoubleSyntaxChecker​(double lowerBound, double upperBound)
      Constructs a syntax checker which accepts all strings representing a double 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

      • DoubleSyntaxChecker

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

        public DoubleSyntaxChecker​(double lowerBound,
                                   double upperBound)
        Constructs a syntax checker which accepts all strings representing a double 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.