Class ExpressionParser.ESPFunction

java.lang.Object
org.bzdev.util.ExpressionParser.ESPFunction
Enclosing class:
ExpressionParser

public class ExpressionParser.ESPFunction extends Object
Class representing an expression-parser lambda expression The lambda expression is evaluated by calling the method invoke(Object...) with the number of arguments specified by numberOfArguments().
  • Method Details

    • isVoid

      public boolean isVoid()
      Determine if the value returned by this function should be ignored.
      Returns:
      true if the value returned by this function should be ignored; false otherwise
    • numberOfArguments

      public int numberOfArguments()
      Get the number of arguments for this lambda expression.
      Returns:
      the number of arguments that may be used with invoke(Object...), excluding an internally provided argument that refers to the current object when the function implements a method.
    • invoke

      public Object invoke(Object... fargs) throws IllegalArgumentException
      Call this function.
      Parameters:
      fargs - this function's arguments
      Returns:
      the result of invoking this function
      Throws:
      IllegalArgumentException - an argument was not appropriate
    • convert

      public <T> T convert(Class<T> fi)
      Convert this function into an implementation of a functional interface.
      Type Parameters:
      T - the type of the functional interface's class.
      Parameters:
      fi - the functional interface's class
      Returns:
      an instance of the functional interface that will call this function.