java.lang.Object
org.bzdev.util.ExpressionParser.ESPFunction
- Enclosing class:
- ExpressionParser
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 Summary
Modifier and TypeMethodDescription<T> T
Convert this function into an implementation of a functional interface.Call this function.boolean
isVoid()
Determine if the value returned by this function should be ignored.int
Get the number of arguments for this lambda expression.
-
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
Call this function.- Parameters:
fargs
- this function's arguments- Returns:
- the result of invoking this function
- Throws:
IllegalArgumentException
- an argument was not appropriate
-
convert
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.
-