<abstract> new BitmaskEnum(name, bitNumber)
Constructor.
Extends:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | the name |
bitNumber |
number | the bit offset, starting from |
Extends
Members
-
bitmaskBitNumber
-
Get the bit offset value, starting from
1for the least significant bit. -
bitmaskBitOffset
-
Get the bit offset value, starting from
0for the least significant bit. -
name
-
Get the enum name.
- Inherited From:
- Overrides:
Methods
-
<static> bitmaskValue(maskables)
-
Get a bitmask value for a set of {@code Bitmaskable} objects.
Parameters:
Name Type Description maskablesIterable.<BitmaskEnum> the set of
BitmaskEnumobjectsReturns:
a bitmask value of all module:util~BitmaskEnum#bitmaskBitOffset() values of the given
maskables- Type
- number
-
<static> enumForBitNumber(bitNumber, values)
-
Get a
BitmaskEnumobjects for a bit number.Parameters:
Name Type Description bitNumbernumber a bit number value of the
BitmaskEnumobject to findvaluesIterable.<BitmaskEnum> the complete set of possible
BitmaskEnumobjectsReturns:
the matching
BitmaskEnum, ornull- Type
- BitmaskEnum
-
<static> setForBitmask(mask, values)
-
Convert a bitmask value into a set of
BitmaskEnumobjects.Parameters:
Name Type Description masknumber a bitmask value of a set of
BitmaskEnumobjectsvaluesIterable.<BitmaskEnum> the complete set of possible
BitmaskEnumobjectsReturns:
a set of
BitmaskEnumobjects- Type
- Set.<BitmaskEnum>
-
<static> setForBitmaskEnum(mask, clazz)
-
Convert a bitmask value into a set of {@code Bitmaskable} objects.
Parameters:
Name Type Description masknumber a bitmask value of a set of {@code Bitmaskable} objects
clazzBitmaskEnum the class of an enumeration of
BitmaskEnumobjectsReturns:
a set of
BitmaskEnumobjects- Type
- Set.<BitmaskEnum>
-
equals(value)
-
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
valueis passed as an actual Enum instance, then if that enum is the same class as this enum it'snameis compared to this instance'sname.Parameters:
Name Type Description valuestring | Enum the value to test
- Inherited From:
- Overrides:
Returns:
trueifvalueis the same as this instance'snamevalue- Type
- boolean