Class Index | File Index

Classes


Class baja.EnumSet


Extends baja.Simple.
Represents a baja:EnumSet in BajaScript.

An EnumSet contains an EnumRange and an array of ordinals.

When creating a Simple, always use the 'make' method instead of creating a new Object.
Defined in: obj.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Decode an EnumSet from a String.
<static>  
baja.EnumSet.DEFAULT
Default EnumSet instance.
 
Encode an EnumSet to a String.
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 data type symbol (E).
 
Return all of the ordinals for the EnumSet
 
make(obj)
Make an EnumSet.
<static>  
baja.EnumSet.make(obj)
Make an EnumSet.
Methods borrowed from class baja.Simple:
equals
Class Detail
baja.EnumSet()
Field Detail
{baja.EnumSet} decodeFromString
Decode an EnumSet from a String.

<static> baja.EnumSet.DEFAULT
Default EnumSet instance.

{String} encodeToString
Encode an EnumSet to a String.
Method Detail
{String} getDataTypeSymbol()
Return the data type symbol (E).
Returns:
{String} data type symbol

{Array} getOrdinals()
Return all of the ordinals for the EnumSet
Returns:
{Array} an array of numbers that represents the ordinals for this EnumSet.

make(obj)
Make an EnumSet. Same as static method baja.EnumSet.make.
Parameters:
obj
See:
baja.EnumSet.make

<static> {baja.EnumSet} baja.EnumSet.make(obj)
Make an EnumSet. An EnumSet can be created using either an array of ordinals (in which case the range will be set to baja.EnumRange.DEFAULT), or, to specify a range as well, an object literal with ordinals and range properties.
  // For example...
  var defaultRange = baja.EnumSet.make([0, 1, 2]);
  var customRange = baja.EnumSet.make({
    ordinals: [0, 2, 4],
    range: baja.EnumRange.make({
      ordinals: [0, 1, 2, 3, 4],
      tags: ['a', 'b', 'c', 'd', 'e']
    })
  });

Parameters:
{Object|Array} obj
the Object Literal that holds the method's arguments (or an array of ordinals).
{Array} obj.ordinals Optional
an array of ordinals.
{baja.EnumRange} obj.range Optional
the EnumRange to assign the EnumSet.
Returns:
{baja.EnumSet} the EnumSet.

Documentation generated by JsDoc Toolkit 2.3.2