Fork me on GitHub

Now on: joopl.EnumValue

Available since 2.3.0

Represents an enumeration value and provides access to common operations for the whole enumeration value.

See Enumerations to learn more about enumerations.

Properties

Methods

and

(
  • enumValue
)
Number

Defined in src\joopl.js:1147

Performs a bitwise AND with the given enumeration value

Parameters:

  • enumValue Number

    An enumeration value

Returns:

Number:

The flag of two or more enumeration values

Example:

var flag = myNamespace.State.open.enum.and(myNamespace.State.closed); // This is State.open & State.closed

hasFlag

(
  • enumValue
)
Boolean

Defined in src\joopl.js:1167

Determines if some enumeration value contains other enumeration value.

Parameters:

  • enumValue Number

    An enumeration value

Returns:

Boolean:

A boolean specifying if the given enumeration value was found in the flag.

Example:

var flag = myNamespace.State.open.enum.or(myNamespace.State.closed);
var hasOpen = flag.enum.hasFlag(myNamespace.State.open);

or

(
  • enumValue
)
Number

Defined in src\joopl.js:1127

Performs a bitwise OR with the given enumeration value

Parameters:

  • enumValue Number

    An enumeration value

Returns:

Number:

The flag of two or more enumeration values

Example:

var flag = myNamespace.State.open.enum.or(State.closed); // This is State.open | State.closed

Properties

name

String

Defined in src\joopl.js:1118

Gets the enumeration value name

value

Number

Defined in src\joopl.js:1110

Gets the enumeration value.