Class baja.FrozenEnum
Extends
baja.Enum.
Represents a baja:FrozenEnum in BajaScript.
In Niagara, a BFrozenEnum is a hard coded set of enumerations and is immutable.
FrozenEnum objects are treated in a special way in BajaScript. A FrozenEnum's range (also known as a Contract in BajaScript) is lazily requested and stored within the BajaScript registry. Therefore, this object shouldn't be used directly. Here's the preferred way of access an FrozenEnum...
var en = baja.$("baja:Weekday").get("monday");
Defined in: obj.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <private> <static> |
baja.FrozenEnum.DEFAULT
Default FrozenEnum instance.
|
- Fields borrowed from class baja.Value:
- newCopy
- Fields borrowed from class baja.Object:
- equivalent, getIcon
| Method Attributes | Method Name and Description |
|---|---|
|
Return the Frozen Enum as a Dynamic Enum.
|
|
| <private> |
Called once a Contract has been loaded onto a FrozenEnum.
|
|
decodeFromString(str)
Decode a FrozenEnum from a String.
|
|
|
Encode the FrozenEnum to a String.
|
|
|
get(arg)
Get a FrozenEnum.
|
|
|
Return the display tag for the FrozenEnum.
|
|
|
Return the ordinal for the frozen enum.
|
|
|
getRange()
Return the range for the frozen enum.
|
|
|
getTag()
Return the tag for the FrozenEnum.
|
|
|
is(arg)
Equals comparison via tag or ordinal.
|
|
|
isActive()
Return true if the enum is active.
|
|
| <private> |
make(arg)
Make a FrozenEnum.
|
|
toString()
Return the String representation of a FrozenEnum.
|
- Methods borrowed from class baja.Simple:
- equals
Field Detail
<private> <static>
baja.FrozenEnum.DEFAULT
Default FrozenEnum instance.
Method Detail
{baja.DynamicEnum}
asDynamic()
Return the Frozen Enum as a Dynamic Enum.
- Returns:
- {baja.DynamicEnum}
<private>
contractCommitted()
Called once a Contract has been loaded onto a FrozenEnum.
This method is designed to be overriden.
{baja.FrozenEnum}
decodeFromString(str)
Decode a FrozenEnum from a String.
- Parameters:
- {String} str
- Returns:
- {baja.FrozenEnum}
{String}
encodeToString()
Encode the FrozenEnum to a String.
- Returns:
- {String}
{baja.FrozenEnum}
get(arg)
Get a FrozenEnum.
This is the primary way to access an enum...
var en = baja.$("baja:Weekday").get("monday");
- Returns:
- {baja.FrozenEnum} the frozen enum.
{String}
getDisplayTag()
Return the display tag for the FrozenEnum.
A display tag is a translated human friendly readable version of a tag.
- Returns:
- {String} display tag.
{Number}
getOrdinal()
Return the ordinal for the frozen enum.
- Returns:
- {Number} ordinal.
{baja.EnumRange}
getRange()
Return the range for the frozen enum.
- Returns:
- {baja.EnumRange} range.
{String}
getTag()
Return the tag for the FrozenEnum.
- Returns:
- {String} tag
{Boolean}
is(arg)
Equals comparison via tag or ordinal.
This is a convenient way to compare enums...
var monday = baja.$("baja:Weekday").get("monday");
baja.outln("Is the day Tuesday?: " + monday.is("tuesday"));
- Parameters:
- {String|Number|baja.FrozenEnum} arg
- the enum, tag or ordinal used for comparison.
- Returns:
- {Boolean} true if equal.
{Boolean}
isActive()
Return true if the enum is active.
- Returns:
- {Boolean} true if active.
<private>
{baja.FrozenEnum}
make(arg)
Make a FrozenEnum.
- Returns:
- {baja.FrozenEnum} the frozen enum.
- See:
- baja.FrozenEnum#make
{String}
toString()
Return the String representation of a FrozenEnum.
- Returns:
- {String} string