Uint16 class
Encapsulates an unsigned 16-bit aggregation.
Also commonly known as a short.
Commonly used to represent:
- USC-2 characters
Properties
- bitsSet → int
-
Returns the number of set bits in value.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isNegative → bool
-
Returns
true
iff value represents a negative number, elsefalse
.no setterinherited - isPositive → bool
-
Returns
true
iff value represents a positive number, elsefalse
.no setterinherited - msb → bool
-
Returns whether the most-significant-bit in value is set.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Numbers of bits in this data type.
finalinherited
- value → int
-
Value wrapped by the Integral.
finalinherited
Methods
-
bitChunk(
int left, int size) → Uint16 -
Returns a new instance with bits in
left
tosize
.inherited -
bitRange(
int left, int right) → Uint16 -
Returns a new instance with bits
left
toright
, inclusive.inherited -
clearBit(
int n) → Uint16 -
Returns with the
n
th bit from value cleared.inherited -
compareTo(
Integral< Integral> o) → int -
Compares this object to another object.
inherited
-
getBit(
int n) → int -
Returns the
n
th bit from value.inherited -
isClear(
int n) → bool -
Returns whether the
n
th bit from value is cleared.inherited -
isSet(
int n) → bool -
Returns whether the
n
th bit from value is set.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceBitRange(
int left, int right, int bits) → Uint16 -
Returns a new instance with bits
left
toright
, inclusive, replaced.inherited -
rotateRightShift(
int number) → Uint16 -
Returns a bit-wise right rotation on value by
number
of bits.inherited -
setBit(
int n) → Uint16 -
Returns with the
n
th bit from value set.inherited -
signedRightShift(
int n) → Uint16 -
Returns value arithmetically right-shifted
n
bits.inherited -
signExtend(
int startSize) → Uint16 -
Returns the current value BinaryInt.signExtend-ed to the full size.
inherited
-
toBinary(
) → String -
Returns value as a binary string representation.
inherited
-
toBinaryPadded(
) → String -
Returns value as a binary string representation, padded with
0
's.inherited -
toDebugString(
) → String -
Returns a debug-friendly representation of toString.
override
-
toggleBit(
int n, [bool? v]) → Uint16 -
Sets the
n
th bit ifv
istrue
, otherwise clears.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
wrapSafeValue(
int value) → Uint16 -
Implement to create an instance of self around
value
.override
Operators
-
operator &(
Uint16 other) → Uint16 -
Bitwise AND operator.
inherited
-
operator <(
Uint16 other) → bool -
Less than comparison.
inherited
-
operator <<(
Uint16 other) → Uint16 -
Left-shift operator.
inherited
-
operator <=(
Uint16 other) → bool -
Less than or equal comparison.
inherited
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
Uint16 other) → bool -
Greater than comparison.
inherited
-
operator >=(
Uint16 other) → bool -
Greater than or equal comparison.
inherited
-
operator >>(
Uint16 other) → Uint16 -
Right-shift operator.
inherited
-
operator ^(
Uint16 other) → Uint16 -
Bitwise XOR operator.
inherited
-
operator |(
Uint16 other) → Uint16 -
Bitwise OR operator.
inherited
-
operator ~(
) → Uint16 -
Bitwise NOT operator.
inherited
Static Methods
-
assertRange(
int value) → int -
Returns
value
. -
checkRange(
int value) → int -
Returns
value
if in range, otherwise throws RangeError.