Class All
- java.lang.Object
-
- org.protelis.lang.interpreter.impl.AbstractProtelisAST<java.lang.Object>
-
- org.protelis.lang.interpreter.impl.All
-
- All Implemented Interfaces:
java.io.Serializable,ProtelisAST<java.lang.Object>,WithBytecode
public final class All extends AbstractProtelisAST<java.lang.Object>
Evaluate a sequence of statements, returning the value of the last statement.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description All(Metadata metadata, java.util.List<ProtelisAST<?>> statements)Block of statements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectevaluate(ExecutionContext context)Evaluates this AST node.BytecodegetBytecode()java.lang.StringgetName()java.lang.StringtoString()-
Methods inherited from class org.protelis.lang.interpreter.impl.AbstractProtelisAST
branchesToString, branchesToString, eval, forEach, forEachWithIndex, getBranch, getBranches, getBranchesNumber, getMetadata, isNullable, stringFor
-
-
-
-
Constructor Detail
-
All
public All(Metadata metadata, java.util.List<ProtelisAST<?>> statements)
Block of statements.- Parameters:
metadata- AMetadataobject containing information about the code that generated this AST node.statements- the statements
-
-
Method Detail
-
evaluate
public java.lang.Object evaluate(ExecutionContext context)
Description copied from class:AbstractProtelisASTEvaluates this AST node. This method can throw any exception,AbstractProtelisASTtakes care of storing the necessary metadata.- Specified by:
evaluatein classAbstractProtelisAST<java.lang.Object>- Parameters:
context- the execution context- Returns:
- the result of the evaluation
-
getName
public java.lang.String getName()
Description copied from class:AbstractProtelisAST- Specified by:
getNamein interfaceProtelisAST<java.lang.Object>- Overrides:
getNamein classAbstractProtelisAST<java.lang.Object>- Returns:
- The name of the operation
-
toString
public java.lang.String toString()
Description copied from class:AbstractProtelisAST- Overrides:
toStringin classAbstractProtelisAST<java.lang.Object>
-
-