Class Index | File Index

Classes


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.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
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 Summary
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.
 
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.
 
Return the range for the frozen enum.
 
Return the tag for the FrozenEnum.
 
is(arg)
Equals comparison via tag or ordinal.
 
Return true if the enum is active.
<private>  
make(arg)
Make a FrozenEnum.
 
Return the String representation of a FrozenEnum.
Methods borrowed from class baja.Simple:
equals
Class Detail
baja.FrozenEnum()
See:
baja.FrozenEnum#get
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}
See:
baja.DynamicEnum#make

<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");
Parameters:
{String|Number} arg
the tag of ordinal of the enum to get.
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.
Parameters:
{String|Number} arg
the tag or ordinal of the frozen enum we want to access.
Returns:
{baja.FrozenEnum} the frozen enum.
See:
baja.FrozenEnum#make

{String} toString()
Return the String representation of a FrozenEnum.
Returns:
{String} string

Documentation generated by JsDoc Toolkit 2.3.2