Class OperatorTreeNode

  • All Implemented Interfaces:
    it.unibo.alchemist.model.sapere.dsl.ITreeNode , java.io.Serializable

    
    public class OperatorTreeNode
    extends ATreeNode<T>
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final Operator operator
      public final T data
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Operator getOperator()
      Type getType()
      Double getValue(Map<HashString, ITreeNode<out Object>> matches)
      String toString()
      • Methods inherited from class it.unibo.alchemist.model.sapere.dsl.impl.ATreeNode

        equals, getData, getLeftChild, getNumberOfChildren, getRightChild, hashCode, toHashString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OperatorTreeNode

        OperatorTreeNode(Operator op, ITreeNode<out Object> left, ITreeNode<out Object> right)
        Parameters:
        op - the operator
        left - left side of the expression
        right - right side of the expression
    • Method Detail

      • getType

         Type getType()
        Returns:

        the type of this node

      • getValue

         Double getValue(Map<HashString, ITreeNode<out Object>> matches)
        Returns:

        the value of the Node. (Double if it's a Num or a Var of type Num, String if it's a Const or a Var of type Const) the method return null if there are some variable not yet allocated in the expression.