Class baja.DynamicEnum
Extends
baja.Enum.
Represents a baja:DynamicEnum in BajaScript.
BDynamicEnum stores an ordinal state variable as a Number. An instance of BEnumRange may be used to specify the range.
When creating a Simple, always use the 'make' method instead of creating a new Object.
Defined in: obj.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
baja.DynamicEnum.DEFAULT
Default DynamicEnum instance.
|
- Fields borrowed from class baja.Value:
- newCopy
- Fields borrowed from class baja.Object:
- equivalent, getIcon
| Method Attributes | Method Name and Description |
|---|---|
|
decodeFromString(str)
Decode a DynamicEnum from a String.
|
|
|
Encode a DynamicEnum to a String.
|
|
|
Return the data type symbol.
|
|
|
Return the ordinal.
|
|
|
getRange()
Return the range.
|
|
|
getTag()
Return the tag for the ordinal.
|
|
|
is(arg)
Equals comparison via tag or ordinal.
|
|
|
isActive()
Return whether the enum is action or not.
|
|
|
make(obj)
Make a DynamicEnum.
|
|
| <static> |
baja.DynamicEnum.make(obj)
Make a DynamicEnum
An ordinal or an Object Literal can be used for the method's arguments. |
|
toString()
Return the String representation of the DynamicEnum.
|
- Methods borrowed from class baja.Simple:
- equals
Field Detail
<static>
baja.DynamicEnum.DEFAULT
Default DynamicEnum instance.
Method Detail
{baja.DynamicEnum}
decodeFromString(str)
Decode a DynamicEnum from a String.
- Parameters:
- {String} str
- Returns:
- {baja.DynamicEnum}
{String}
encodeToString()
Encode a DynamicEnum to a String.
- Returns:
- {String}
{String}
getDataTypeSymbol()
Return the data type symbol.
- Returns:
- {String} the data type symbol.
{Number}
getOrdinal()
Return the ordinal.
- Returns:
- {Number} the ordinal.
{baja.EnumRange}
getRange()
Return the range.
- Returns:
- {baja.EnumRange} the enum range.
{String}
getTag()
Return the tag for the ordinal.
- Returns:
- {String} the tag.
{Boolean}
is(arg)
Equals comparison via tag or ordinal.
- Parameters:
- {String|Number|baja.DynamicEnum} arg
- the enum, tag or ordinal used for comparison.
- Returns:
- {Boolean} true if equal.
{Boolean}
isActive()
Return whether the enum is action or not.
- Returns:
- {Boolean} true if active.
{baja.DynamicEnum}
make(obj)
Make a DynamicEnum.
An ordinal or an Object Literal can be used for the method's arguments...
var de1 = baja.$("baja:DynamicEnum").make(0); // Just with an ordinal
//... or with an Object Literal...
var de2 = baja.$("baja:DynamicEnum").make({ordinal: 0, range: enumRange});
//...or create from another enumeration...
var de3 = baja.$("baja:DynamicEnum").make({en: anEnum});
- Parameters:
- {Object|Number} obj Optional
- the Object Literal for the method's arguments or an ordinal.
- {Number} obj.ordinal Optional
- the ordinal for the enum.
- {baja.EnumRange} obj.range Optional
- the range for the enum.
- {baja.DynamicEnum|baja.FrozenEnum|Boolean|String} obj.en Optional
- if defined, this enum will be used for the ordinal and range. As well as an enum, this can also be a TypeSpec String (moduleName:typeName) for a FrozenEnum.
- Returns:
- {baja.DynamicEnum} the DynamicEnum.
<static>
{baja.DynamicEnum}
baja.DynamicEnum.make(obj)
Make a DynamicEnum
An ordinal or an Object Literal can be used for the method's arguments...
var de1 = baja.DynamicEnum.make(0); // Just with an ordinal
//... or with an Object Literal...
var de2 = baja.DynamicEnum.make({ordinal: 0, range: enumRange});
//...or create from another enumeration...
var de3 = baja.DynamicEnum.make({en: anEnum});
- Parameters:
- {Object|Number} obj Optional
- the Object Literal for the method's arguments or an ordinal.
- {Number} obj.ordinal Optional
- the ordinal for the enum.
- {baja.EnumRange} obj.range Optional
- the range for the enum.
- {baja.DynamicEnum|baja.FrozenEnum|Boolean|String} obj.en Optional
- if defined, this enum will be used for the ordinal and range. As well as an enum, this can also be a TypeSpec String (moduleName:typeName) for a FrozenEnum.
- Returns:
- {baja.DynamicEnum} the DynamicEnum.
{String}
toString()
Return the String representation of the DynamicEnum.
- Returns:
- {String}