Constructor
(abstract) new BitmaskEnum(name, bitNumber)
Constructor.
Name | Type | Description |
---|---|---|
name | string | the name |
bitNumber | number | the bit offset, starting from |
- Source
Extends
Members
bitmaskBitNumber
Get the bit offset value, starting from 1
for the least significant bit.
- Source
bitmaskBitOffset
Get the bit offset value, starting from 0
for the least significant bit.
- Source
name
Get the enum name.
- Overrides
- Source
Methods
equals(value) → {boolean}
Test if a string is equal to this enum's name.
As long as enum values are consistently obtained from the module:util~Enum.enumValues array then enum instances can be compared with ===
. If unsure, this method can be used to compare string values instead.
If value
is passed as an actual Enum instance, then if that enum is the same class as this enum it's name
is compared to this instance's name
.
Name | Type | Description |
---|---|---|
value | string | | the value to test |
- Overrides
- Source
true
if value
is the same as this instance's name
value
- Type:
- boolean
(static) bitmaskValue(maskables) → {number}
Get a bitmask value for a set of {@code Bitmaskable} objects.
Name | Type | Description |
---|---|---|
maskables | Iterable.<BitmaskEnum> | the set of |
- Source
a bitmask value of all module:util~BitmaskEnum#bitmaskBitOffset() values of the given maskables
- Type:
- number
(static) enumForBitNumber(bitNumber, values) → {BitmaskEnum}
Get a BitmaskEnum
objects for a bit number.
Name | Type | Description |
---|---|---|
bitNumber | number | a bit number value of the |
values | Iterable.<BitmaskEnum> | the complete set of possible |
- Source
the matching BitmaskEnum
, or null
- Type:
- BitmaskEnum
(static) setForBitmask(mask, values) → {Set.<BitmaskEnum>}
Convert a bitmask value into a set of BitmaskEnum
objects.
Name | Type | Description |
---|---|---|
mask | number | a bitmask value of a set of |
values | Iterable.<BitmaskEnum> | the complete set of possible |
- Source
a set of BitmaskEnum
objects
- Type:
- Set.<BitmaskEnum>
(static) setForBitmaskEnum(mask, clazz) → {Set.<BitmaskEnum>}
Convert a bitmask value into a set of {@code Bitmaskable} objects.
Name | Type | Description |
---|---|---|
mask | number | a bitmask value of a set of {@code Bitmaskable} objects |
clazz | BitmaskEnum | the class of an enumeration of |
- Source
a set of BitmaskEnum
objects
- Type:
- Set.<BitmaskEnum>