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.Object
evaluate(ExecutionContext context)
Evaluates this AST node.Bytecode
getBytecode()
java.lang.String
getName()
java.lang.String
toString()
-
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
- AMetadata
object 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:AbstractProtelisAST
Evaluates this AST node. This method can throw any exception,AbstractProtelisAST
takes care of storing the necessary metadata.- Specified by:
evaluate
in 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:
getName
in interfaceProtelisAST<java.lang.Object>
- Overrides:
getName
in classAbstractProtelisAST<java.lang.Object>
- Returns:
- The name of the operation
-
toString
public java.lang.String toString()
Description copied from class:AbstractProtelisAST
- Overrides:
toString
in classAbstractProtelisAST<java.lang.Object>
-
-