Class BitFunction

All Implemented Interfaces:
NamedExpression, HasSQL, Typed

public final class BitFunction extends Function1_2
A bitwise function.
  • Field Details

  • Constructor Details

  • Method Details

    • getValue

      public Value getValue(SessionLocal session, Value v1, Value v2)
      Description copied from class: Function1_2
      Returns the value of this function.
      Overrides:
      getValue in class Function1_2
      Parameters:
      session - the session
      v1 - the value of first argument
      v2 - the value of second argument, or null
      Returns:
      the resulting value
    • getBitwise

      public static Value getBitwise(int function, TypeInfo type, Value v1, Value v2)
      Computes the value of bitwise function.
      Parameters:
      function - one of BITAND, BITOR, BITXOR, BITNOT, BITNAND, BITNOR, BITXNOR
      type - the type of result
      v1 - the value of first argument
      v2 - the value of second argument, or null
      Returns:
      the resulting value
    • optimize

      public Expression optimize(SessionLocal session)
      Description copied from class: Expression
      Try to optimize the expression.
      Specified by:
      optimize in class Expression
      Parameters:
      session - the session
      Returns:
      the optimized expression
    • checkArgType

      public static TypeInfo checkArgType(Expression arg)
      Checks the type of an argument of bitwise function (one of BITAND, BITOR, BITXOR, BITNOT, BITNAND, BITNOR, BITXNOR).
      Parameters:
      arg - the argument
      Returns:
      the type of the specified argument
      Throws:
      DbException - if argument type is not supported by bitwise functions
    • getName

      public String getName()
      Description copied from interface: NamedExpression
      Get the name.
      Returns:
      the name in uppercase