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 Tuple
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
-
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
- AMetadata
object containing information about the code that generated this AST node.argument
- the field on whichAlignedMap
should be appliedfilter
- filtering functionoperation
- function to rundefaultValue
- default value
-
-
Method Detail
-
evaluate
public Tuple 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<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:
getName
in interfaceProtelisAST<Tuple>
- Overrides:
getName
in classAbstractProtelisAST<Tuple>
- Returns:
- The name of the operation
-
toString
public java.lang.String toString()
Description copied from class:AbstractProtelisAST
- Overrides:
toString
in classAbstractProtelisAST<Tuple>
-
-