Class UnaryArithmeticOperatorNode

  • All Implemented Interfaces:
    Visitable

    class UnaryArithmeticOperatorNode
    extends UnaryOperatorNode
    This node represents a unary arithmetic operator
    • Method Detail

      • requiresTypeFromContext

        public boolean requiresTypeFromContext()
        Unary + and - require their type to be set if they wrap another node (e.g. a parameter) that requires type from its context.
        Overrides:
        requiresTypeFromContext in class ValueNode
        Returns:
        Whether this node's type will be determined from the context
        See Also:
        ValueNode.requiresTypeFromContext()
      • isParameterNode

        public boolean isParameterNode()
        A +? or a -? is considered a parameter.
        Overrides:
        isParameterNode in class ValueNode
      • bindParameter

        void bindParameter()
                    throws StandardException
        For SQRT and ABS the parameter becomes a DOUBLE. For unary + and - no change is made to the underlying node. Once this node's type is set using setType, then the underlying node will have its type set.
        Overrides:
        bindParameter in class UnaryOperatorNode
        Throws:
        StandardException - Thrown if ? parameter doesn't have a type bound to it yet. ? parameter where it isn't allowed.
      • setType

        void setType​(DataTypeDescriptor descriptor)
              throws StandardException
        We are overwriting this method here because for -?/+?, we now know the type of these dynamic parameters and hence we can do the parameter binding. The setType method will call the binding code after setting the type of the parameter
        Overrides:
        setType in class ValueNode
        Parameters:
        descriptor - The DataTypeServices to set in this ValueNode
        Throws:
        StandardException
      • isSameNodeKind

        boolean isSameNodeKind​(ValueNode o)
        Description copied from class: ValueNode
        Some node classes represent several logical node types (to reduce footprint), which we call kinds. This means that implementations of ValueNode.isEquivalent(org.apache.derby.impl.sql.compile.ValueNode) cannot always just use instanceof to check if the other node represents the same kind. Hence this method needs to be overridden by all node classes that represent several kinds. This default implementation does not look at kinds. It is only called from implementations of isEquivalent.
        Overrides:
        isSameNodeKind in class UnaryOperatorNode
        Parameters:
        o - The other value node whose kind we want to compare with.
        Returns:
        true if this and o represent the same logical node type, i.e. kind.