Class BinaryExpr<T>

    • Constructor Detail

      • BinaryExpr

        public BinaryExpr​(T operator,
                          Expr left,
                          Expr right)
        Create a new BinaryExpr.
        Parameters:
        operator - the operator
        left - the left operand
        right - the right operand
    • Method Detail

      • getOperator

        public T getOperator()
        Get the operator.
        Returns:
        the operator
      • getLeft

        public Expr getLeft()
        Get the left operand.
        Returns:
        the left operand
      • getRight

        public Expr getRight()
        Get the right operand.
        Returns:
        the right operand
      • isBinary

        public boolean isBinary()
        Description copied from interface: Expr
        Check if this expression is a binary expression.
        Specified by:
        isBinary in interface Expr
        Returns:
        if it is a binary expression
      • asBinary

        public Optional<BinaryExpr<?>> asBinary()
        Description copied from interface: Expr
        Get this expression as a binary expression
        Specified by:
        asBinary in interface Expr
        Returns:
        the expression or Optional.empty() if the type does not match
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object