Package com.blackrook.expression.node
Interface ExpressionFunctionType
-
- All Known Implementing Classes:
CommonFunctions
public interface ExpressionFunctionType
Describes a type of function entry point.- Author:
- Matthew Tropiano
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
execute(ExpressionStack stack, ExpressionVariableContext context)
Executes this function.int
getArgumentCount()
boolean
isCollapsable()
Checks if this node type is collapsable.String
name()
Gets the name of this function.
-
-
-
Method Detail
-
name
String name()
Gets the name of this function. This name returned must be a valid name that can be parsed in the script ("identifier" type: starts with letter, alphanumeric plus "_").- Returns:
- the function name.
-
getArgumentCount
int getArgumentCount()
- Returns:
- the amount of arguments this takes.
-
isCollapsable
boolean isCollapsable()
Checks if this node type is collapsable. "Collapsible" functions should be completely deterministic and stable (returns the same things given the same input). This aids in optimizing scripts.- Returns:
- true if so, false if not.
-
execute
boolean execute(ExpressionStack stack, ExpressionVariableContext context)
Executes this function.- Parameters:
stack
- the stack to use.context
- the context for added variables.- Returns:
- if false, this halts script execution, else if true, continue.
-
-