Home Manual Reference Source Test Repository
public class | source

Enum

Direct Subclass:

ReportType, ReportType

This is an abstract class that is not intended to be used directly. Extend it to turn your class into an enum (initialization is performed via MyClass.initEnum()).

Modified from source provided by enumify (license unlisted / public domain)

See:

Static Method Summary

Static Public Methods
public static

[Symbol.iterator](): Symbol.iterator

Make enum classes iterable

public static

enumValueOf(name: string): T

Given the name of an enum constant, return its value.

public static

Set up the enum, close the class.

Static Private Methods
private static
private static
private static

_pushEnumValue(enumValue: *, name: *)

Constructor Summary

Public Constructor
public

constructor(instanceProperties: object)

initEnum() closes the class.

Method Summary

Public Methods
public

Default toString() method for enum constant.

Static Public Methods

public static [Symbol.iterator](): Symbol.iterator source

Make enum classes iterable

Return:

Symbol.iterator

public static enumValueOf(name: string): T source

Given the name of an enum constant, return its value.

Params:

NameTypeAttributeDescription
name string

An enum name.

Return:

T

public static initEnum(arg: Array | object): Enum source

Set up the enum, close the class.

Params:

NameTypeAttributeDescription
arg Array | object

Either an object whose properties provide the names and values (which must be mutable objects) of the enum constants. Or an Array whose elements are used as the names of the enum constants. The values are create by instantiating the current class.

Return:

Enum

Static Private Methods

private static _enumValuesFromArray(arr: *) source

Params:

NameTypeAttributeDescription
arr *

private static _enumValuesFromObject(obj: *) source

Params:

NameTypeAttributeDescription
obj *

private static _pushEnumValue(enumValue: *, name: *) source

Params:

NameTypeAttributeDescription
enumValue *
name *

Public Constructors

public constructor(instanceProperties: object) source

initEnum() closes the class. Then calling this constructor throws an exception.

If your subclass has a constructor then you can control what properties are added to this via the argument you pass to super(). No arguments are fine, too.

Params:

NameTypeAttributeDescription
instanceProperties object

Provides initial properties.

Public Methods

public toString(): string source

Default toString() method for enum constant.

Return:

string