Abstraction of types that are conceptually a sequence of bits, and may be the subject of bitwise operations. A bit is a `Boolean` value. Bits are indexed from right to left, where `0` is the index of the least significant bit.

By: Stef
See also `Integer`

no type hierarchy

no supertypes hierarchy

- `Binary` of
  - `Byte`
  - `Integer`

Attributes
`not` | Source Code `shared formal Other not` The binary complement of this sequence of bits.

Inherited Attributes
Attributes inherited from: `Object` `hash`, `string`

Methods
`and` | Source Code `shared formal Other and(Other other)` Performs a logical AND operation.
`clear` | Source Code `shared default Other clear(Integer index)` Returns an instance with the given bit set to 0 if `0 <= index < size`, otherwise returns a value with the same bits as this value.
`flip` | Source Code `shared formal Other flip(Integer index)` Returns an instance with the given bit flipped to its opposite value if `0 <= index < size`, otherwise returns a value with the same bits as this value.
`get` | Source Code `shared formal Boolean get(Integer index)` Retrieves a given bit from this bit sequence if `0 <= index < size`, otherwise returns false.
`leftLogicalShift` | Source Code `shared formal Other leftLogicalShift(Integer shift)` Shift the sequence of bits to the left, by the given number of places, filling the least significant bits with zeroes.
`or` | Source Code `shared formal Other or(Other other)` Performs a logical inclusive OR operation.
`rightArithmeticShift` | Source Code `shared formal Other rightArithmeticShift(Integer shift)` Shift the sequence of bits to the right, by the given number of places, preserving the values of the most significant bits. If the sequence of bits represents a signed integer, the sign is preserved.
`rightLogicalShift` | Source Code `shared formal Other rightLogicalShift(Integer shift)` Shift the sequence of bits to the right, by the given number of places, filling the most significant bits with zeroes. If the sequence of bits represents a signed integer, the sign is not preserved.
`set` | Source Code `shared formal Other set(Integer index, Boolean bit = true)` Returns an instance with the given bit set to the given value if `0 <= index < size`, otherwise returns a value with the same bits as this value. Parameters: `bit = true`
`xor` | Source Code `shared formal Other xor(Other other)` Performs a logical exclusive OR operation.

Inherited Methods
Methods inherited from: `Object` `equals()`