org.h2.expression.function

## Class BitFunction

- java.lang.Object
- - org.h2.expression.Expression
  - - org.h2.expression.Operation1_2
    - - org.h2.expression.function.Function1_2
      - - org.h2.expression.function.BitFunction

All Implemented Interfaces:
  NamedExpression, HasSQL, Typed

    public final class BitFunction
    extends Function1_2

A bitwise function.

### Field Summary

Fields
`static int` `BITAND` BITAND() (non-standard).
`static int` `BITCOUNT` BITCOUNT() (non-standard).
`static int` `BITGET` BITGET() (non-standard).
`static int` `BITNAND` BITNAND() (non-standard).
`static int` `BITNOR` BITNOR() (non-standard).
`static int` `BITNOT` BITNOT() (non-standard).
`static int` `BITOR` BITOR() (non-standard).
`static int` `BITXNOR` BITXNOR() (non-standard).
`static int` `BITXOR` BITXOR() (non-standard).
`static int` `LSHIFT` LSHIFT() (non-standard).
`static int` `ROTATELEFT` ROTATELEFT() (non-standard).
`static int` `ROTATERIGHT` ROTATERIGHT() (non-standard).
`static int` `RSHIFT` RSHIFT() (non-standard).
`static int` `ULSHIFT` ULSHIFT() (non-standard).
`static int` `URSHIFT` URSHIFT() (non-standard).

### Fields inherited from class org.h2.expression.Operation1_2

`left, right, type`

### Fields inherited from class org.h2.expression.Expression

`AUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESES`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

### Constructor Summary

Constructors
Constructor and Description
`BitFunction(Expression arg1, Expression arg2, int function)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static TypeInfo` `checkArgType(Expression arg)` Checks the type of an argument of bitwise function (one of `BITAND`, `BITOR`, `BITXOR`, `BITNOT`, `BITNAND`, `BITNOR`, `BITXNOR`).
`static Value` `getBitwise(int function, TypeInfo type, Value v1, Value v2)` Computes the value of bitwise function.
`java.lang.String` `getName()` Get the name.
`Value` `getValue(SessionLocal session, Value v1, Value v2)` Returns the value of this function.
`Expression` `optimize(SessionLocal session)` Try to optimize the expression.

### Methods inherited from class org.h2.expression.function.Function1_2

`getUnenclosedSQL, getValue`

### Methods inherited from class org.h2.expression.Operation1_2

`getCost, getSubexpression, getSubexpressionCount, getType, isEverything, mapColumns, setEvaluatable, updateAggregate`

### Methods inherited from class org.h2.expression.Expression

`addFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getTableAlias, getTableName, getWhenSQL, getWhenValue, isConstant, isIdentity, isNullConstant, isValueSet, isWhenConditionOperand, needParentheses, optimizeCondition, toString, writeExpressions, writeExpressions`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

### Field Detail

#### BITAND

    public static final int BITAND

BITAND() (non-standard).

See Also:
  Constant Field Values

#### BITOR

    public static final int BITOR

BITOR() (non-standard).

See Also:
  Constant Field Values

#### BITXOR

    public static final int BITXOR

BITXOR() (non-standard).

See Also:
  Constant Field Values

#### BITNOT

    public static final int BITNOT

BITNOT() (non-standard).

See Also:
  Constant Field Values

#### BITNAND

    public static final int BITNAND

BITNAND() (non-standard).

See Also:
  Constant Field Values

#### BITNOR

    public static final int BITNOR

BITNOR() (non-standard).

See Also:
  Constant Field Values

#### BITXNOR

    public static final int BITXNOR

BITXNOR() (non-standard).

See Also:
  Constant Field Values

#### BITGET

    public static final int BITGET

BITGET() (non-standard).

See Also:
  Constant Field Values

#### BITCOUNT

    public static final int BITCOUNT

BITCOUNT() (non-standard).

See Also:
  Constant Field Values

#### LSHIFT

    public static final int LSHIFT

LSHIFT() (non-standard).

See Also:
  Constant Field Values

#### RSHIFT

    public static final int RSHIFT

RSHIFT() (non-standard).

See Also:
  Constant Field Values

#### ULSHIFT

    public static final int ULSHIFT

ULSHIFT() (non-standard).

See Also:
  Constant Field Values

#### URSHIFT

    public static final int URSHIFT

URSHIFT() (non-standard).

See Also:
  Constant Field Values

#### ROTATELEFT

    public static final int ROTATELEFT

ROTATELEFT() (non-standard).

See Also:
  Constant Field Values

#### ROTATERIGHT

    public static final int ROTATERIGHT

ROTATERIGHT() (non-standard).

See Also:
  Constant Field Values

### Constructor Detail

#### BitFunction

    public BitFunction(Expression arg1,
                       Expression arg2,
                       int function)

### Method Detail

#### 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 java.lang.String getName()

Description copied from interface: `NamedExpression`
Get the name.

Returns:
  the name in uppercase