Class NumberParser<T extends Number>

    • Constructor Detail

      • NumberParser

        public NumberParser()
    • Method Detail

      • operators

        public List<String> operators()
        Description copied from interface: Parser
        Returns the list of operators which can be used with this parser.
        Specified by:
        operators in interface Parser<T extends Number>
        Returns:
        A list of operators.
      • getSymbol

        public String getSymbol​(String text)
        Description copied from interface: Parser
        Return the symbol related to an operator text which can be used with this parser.
        Specified by:
        getSymbol in interface Parser<T extends Number>
        Parameters:
        text - The operator text
        Returns:
        A symbol.
      • isValid

        public boolean isValid​(String text)
        Description copied from interface: Parser
        Checks if the supplied text is valid or not.
        Specified by:
        isValid in interface Parser<T extends Number>
        Parameters:
        text - The text to be validated.
        Returns:
        true if text is valid, else returns false.
      • getErrorMessage

        public String getErrorMessage()
        Description copied from interface: Parser
        A string with the error message if the parser fails to parse the supplied string.
        Specified by:
        getErrorMessage in interface Parser<T extends Number>
        Returns:
        An error message if the parse fails.