java.lang.Object
technology.sola.script.runtime.SolaScriptFunction
- All Implemented Interfaces:
SolaScriptCallable
SolaScriptFunction is a runtime definition of a function declaration that is callable (implements
SolaScriptCallable
interface).-
Constructor Summary
ConstructorsConstructorDescriptionSolaScriptFunction
(Consumer<Stmt> executeStatement, ScriptRuntime scriptRuntime, Stmt.Function declaration) Creates an instance of the runtime function declaration. -
Method Summary
-
Constructor Details
-
SolaScriptFunction
public SolaScriptFunction(Consumer<Stmt> executeStatement, ScriptRuntime scriptRuntime, Stmt.Function declaration) Creates an instance of the runtime function declaration.- Parameters:
executeStatement
- the consumer that handles execution at runtimescriptRuntime
- theScriptRuntime
statedeclaration
- theStmt.Function
declaration
-
-
Method Details
-
arity
public int arity()Description copied from interface:SolaScriptCallable
The number of expected arguments.- Specified by:
arity
in interfaceSolaScriptCallable
- Returns:
- the number of expected arguments
-
call
Description copied from interface:SolaScriptCallable
Calls the function passing along the arguments for the call and returning an evaluated value.- Specified by:
call
in interfaceSolaScriptCallable
- Parameters:
arguments
- the arguments for the call- Returns:
- the evaluated value
-