Declarative Objectivity (DO) Language : Operator Expressions : Bitwise Operators
Bitwise Operators
Bitwise operators perform bit-level operations on operands that are bit patterns or binary numerals.    
Operator
Description
Usage
First Operand
(op1)
Second Operand
(op2)
Result Type
&
BIT_AND
Bitwise conjunction
op1 & op2
op1 BIT_AND op2
BIT_AND(op1, op2)
Integer
Integer
Integer
|
BIT_OR
Bitwise disjunction
op1 | op2
op1 BIT_OR op2
BIT_OR(op1, op2)
Integer
Integer
Integer
^
BIT_XOR
Bitwise exclusive disjunction
op1 ^ op2
op1 BIT_XOR op2
BIT_XOR(op1, op2)
Integer
Integer
Integer
~
BIT_COMP
Bitwise complement
~op1
BIT_COMP(op1)
Integer
Integer
>>
Shift right
op1 >> op2
Integer
Integer
Integer
<<
Shift left
op1 << op2
Integer
Integer
Integer
Discussion 
For general information about operator formats, operands, and precedence, see About Operator Expressions.
Example. Assume a Report class has a status attribute for storing a single integer that represents a combination of Boolean values. When qualifying objects of this class, the expression in the WHERE clause evaluates to true if all of the bits in status are on.
FROM Report WHERE (status & 0xFF) == 0xFF RETURN *;