Class AlignedMap
- java.lang.Object
-
- org.protelis.lang.interpreter.impl.AbstractProtelisAST<Tuple>
-
- org.protelis.lang.interpreter.impl.AlignedMap
-
- All Implemented Interfaces:
java.io.Serializable,ProtelisAST<Tuple>,WithBytecode
public final class AlignedMap extends AbstractProtelisAST<Tuple>
Operation evaluating a collection of expressions associated with keys, such as a set of publish-subscribe streams. This allows devices with different sets of keys to align the expressions that share keys together.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AlignedMap(HashingFunnel hasher, Metadata metadata, ProtelisAST<Field<?>> argument, ProtelisAST<FunctionDefinition> filter, ProtelisAST<FunctionDefinition> operation, ProtelisAST<?> defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tupleevaluate(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
-
AlignedMap
public AlignedMap(HashingFunnel hasher, Metadata metadata, ProtelisAST<Field<?>> argument, ProtelisAST<FunctionDefinition> filter, ProtelisAST<FunctionDefinition> operation, ProtelisAST<?> defaultValue)
- Parameters:
hasher- a function producing a valid, reproducible, and unambiguous hash for arbitrary objectsmetadata- AMetadataobject containing information about the code that generated this AST node.argument- the field on whichAlignedMapshould be appliedfilter- filtering functionoperation- function to rundefaultValue- default value
-
-
Method Detail
-
evaluate
public Tuple 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<Tuple>- 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<Tuple>- Overrides:
getNamein classAbstractProtelisAST<Tuple>- Returns:
- The name of the operation
-
toString
public java.lang.String toString()
Description copied from class:AbstractProtelisAST- Overrides:
toStringin classAbstractProtelisAST<Tuple>
-
-