All Implemented Interfaces:
FromSourceLocation, ToNode, TypeCheck, ToCondition, ToExpression

public final class Substring extends LibraryFunction
A rule-set function for getting the substring of a string value.
  • Field Details

  • Method Details

    • getDefinition

      public static Substring.Definition getDefinition()
      Gets the FunctionDefinition implementation.
      Returns:
      the function definition.
    • ofExpressions

      public static Substring ofExpressions(ToExpression expression, ToExpression startIndex, ToExpression stopIndex, ToExpression reverse)
      Creates a Substring function from the given expressions.
      Parameters:
      expression - the string to extract from.
      startIndex - the starting index.
      stopIndex - the ending index.
      reverse - the reverse order argument.
      Returns:
      The resulting Substring function.
    • ofExpressions

      public static Substring ofExpressions(ToExpression expression, int startIndex, int stopIndex, boolean reverse)
      Creates a Substring function from the given expressions.
      Parameters:
      expression - the string to extract from.
      startIndex - the starting index.
      stopIndex - the ending index.
      reverse - the reverse order argument.
      Returns:
      The resulting Substring function.
    • accept

      public <T> T accept(ExpressionVisitor<T> visitor)
      Description copied from class: Expression
      Invoke the ExpressionVisitor functions for this expression.
      Specified by:
      accept in class Expression
      Type Parameters:
      T - the visitor return type.
      Parameters:
      visitor - the visitor to be invoked.
      Returns:
      the return value of the visitor.