Interface Parser<T>

  • Type Parameters:
    T - Type of input to the Parser
    All Known Implementing Classes:
    NumberParser, StringParser

    public interface Parser<T>
    A parser accepts a string and returns a Predicate depending on its implementation.
    • Method Detail

      • operators

        List<String> operators()
        Returns the list of operators which can be used with this parser.
        A list of operators.
      • getSymbol

        String getSymbol​(String text)
        Return the symbol related to an operator text which can be used with this parser.
        text - The operator text
        A symbol.
      • isValid

        boolean isValid​(String text)
        Checks if the supplied text is valid or not.
        text - The text to be validated.
        true if text is valid, else returns false.
      • getErrorMessage

        String getErrorMessage()
        A string with the error message if the parser fails to parse the supplied string.
        An error message if the parse fails.
      • aggregate

        default Predicate<T> aggregate​(String text)
        Aggregates a text i.e. performs aggregation before parsing the text.
        text - The text on which aggregation is to be performed
        A predicated by aggregating the text or null if the text cannot be aggregated.