Package com.blackrook.expression.node
Class ExpressionFunction
- java.lang.Object
-
- com.blackrook.expression.node.ExpressionFunction
-
- All Implemented Interfaces:
ExpressionNode
public class ExpressionFunction extends Object implements ExpressionNode
Single expression function.- Author:
- Matthew Tropiano
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExpressionFunctioncreate(ExpressionFunctionType type)Creates a new Expression function.booleanexecute(ExpressionStack stack, ExpressionVariableContext context)Executes this node.booleanisCollapsable()Checks if this node is collapsable.StringtoString()voidwriteBytes(OutputStream out)Write value as bytes (for digest later).
-
-
-
Method Detail
-
create
public static ExpressionFunction create(ExpressionFunctionType type)
Creates a new Expression function.- Parameters:
type- the function type.- Returns:
- a new expression directive.
-
isCollapsable
public boolean isCollapsable()
Description copied from interface:ExpressionNodeChecks if this node is collapsable.- Specified by:
isCollapsablein interfaceExpressionNode- Returns:
- true if so, false if not.
-
execute
public boolean execute(ExpressionStack stack, ExpressionVariableContext context)
Description copied from interface:ExpressionNodeExecutes this node.- Specified by:
executein interfaceExpressionNode- Parameters:
stack- the stack to use.context- the context for added variables.- Returns:
- if false, stop expression calculation, else if true, continue.
-
writeBytes
public void writeBytes(OutputStream out) throws IOException
Description copied from interface:ExpressionNodeWrite value as bytes (for digest later).- Specified by:
writeBytesin interfaceExpressionNode- Parameters:
out- the output stream.- Throws:
IOException- on a write error.
-
-