Direct Known Satisfying Classes: Integer

Abstraction of numeric types like Integer that may be represented as a sequence of bits, and may be the subject of bitwise operations.

By: Stef
See also: Integer
Attributes
notSource Code
shared formal Other not

The binary complement of this sequence of bits.

sizeSource Code
shared formal Integer size

The number of bits (0 or 1) that this sequence of bits can hold.

Inherited Attributes
Attributes inherited from: Object
Methods
andSource Code
shared formal Other and(Other other)

Performs a logical AND operation.

clearSource Code
shared default Other clear(Integer index)

Returns a new number with the given bit set to 0. Bits are indexed from right to left.

flipSource Code
shared formal Other flip(Integer index)

Returns a new number with the given bit flipped to its opposite value. Bits are indexed from right to left.

getSource Code
shared formal Boolean get(Integer index)

Retrieves a given bit from this bit sequence. Bits are indexed from right to left.

leftLogicalShiftSource Code
shared formal Other leftLogicalShift(Integer shift)

Performs a left logical shift. Sign is not preserved. Padded with zeros.

orSource Code
shared formal Other or(Other other)

Performs a logical inclusive OR operation.

rightArithmeticShiftSource Code
shared formal Other rightArithmeticShift(Integer shift)

Performs a right arithmetic shift. Sign is preserved. Padded with zeros.

rightLogicalShiftSource Code
shared formal Other rightLogicalShift(Integer shift)

Performs a right logical shift. Sign is not preserved. Padded with zeros.

setSource Code
shared formal Other set(Integer index, Boolean bit = true)

Returns a new number with the given bit set to the given value. Bits are indexed from right to left.

Parameters:
  • bit = true
xorSource Code
shared formal Other xor(Other other)

Performs a logical exclusive OR operation.

Inherited Methods
Methods inherited from: Object