@qubit-ltd/common-decorator 3.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +1156 -0
- package/README.zh_CN.md +929 -0
- package/dist/common-decorator.cjs +6818 -0
- package/dist/common-decorator.cjs.map +1 -0
- package/dist/common-decorator.min.cjs +1 -0
- package/dist/common-decorator.min.cjs.map +1 -0
- package/dist/common-decorator.min.mjs +1 -0
- package/dist/common-decorator.min.mjs.map +1 -0
- package/dist/common-decorator.mjs +6792 -0
- package/dist/common-decorator.mjs.map +1 -0
- package/doc/api/DefaultAssignmentOptions.html +678 -0
- package/doc/api/DefaultOptions.html +954 -0
- package/doc/api/DefaultToJsonOptions.html +633 -0
- package/doc/api/Enum.html +1848 -0
- package/doc/api/Model.html +3607 -0
- package/doc/api/Page.html +1105 -0
- package/doc/api/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Bold-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-BoldItalic-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Italic-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Light-webfont.svg +1839 -0
- package/doc/api/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-LightItalic-webfont.svg +1843 -0
- package/doc/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Regular-webfont.svg +1839 -0
- package/doc/api/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/doc/api/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.svg +1838 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/doc/api/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/doc/api/global.html +6049 -0
- package/doc/api/index.html +1325 -0
- package/doc/api/scripts/linenumber.js +34 -0
- package/doc/api/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/doc/api/scripts/prettify/lang-css.js +2 -0
- package/doc/api/scripts/prettify/prettify.js +28 -0
- package/doc/api/styles/jsdoc-default.css +699 -0
- package/doc/api/styles/prettify-jsdoc.css +120 -0
- package/doc/api/styles/prettify-tomorrow.css +141 -0
- package/doc/common-decorator.min.visualization.html +4949 -0
- package/doc/common-decorator.visualization.html +4949 -0
- package/package.json +107 -0
|
@@ -0,0 +1,1848 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<title>Enum - Documentation</title>
|
|
7
|
+
|
|
8
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
9
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
10
|
+
<!--[if lt IE 9]>
|
|
11
|
+
<script src="https://cdn.bootcdn.net/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
|
12
|
+
<![endif]-->
|
|
13
|
+
<link type="text/css" rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
|
|
19
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
20
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
21
|
+
<div class="navicon"></div>
|
|
22
|
+
</label>
|
|
23
|
+
|
|
24
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
25
|
+
|
|
26
|
+
<nav>
|
|
27
|
+
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="DefaultAssignmentOptions.html">DefaultAssignmentOptions</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="DefaultOptions.html">DefaultOptions</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DefaultOptions.html#.get">get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DefaultOptions.html#.merge">merge</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DefaultOptions.html#.reset">reset</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DefaultOptions.html#.set">set</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="DefaultToJsonOptions.html">DefaultToJsonOptions</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Page.html">Page</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Page.html#assign">assign</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Page.html#.getFrom">getFrom</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Page.html#.newEmpty">newEmpty</a></span></li><li class="nav-heading">Namespaces</li><li class="nav-heading"><span class="nav-item-type type-namespace">N</span><span class="nav-item-name"><a href="Enum.html">Enum</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.has">Class.has</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.hasCode">Class.hasCode</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.hasName">Class.hasName</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.hasValue">Class.hasValue</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.of">Class.of</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.ofCode">Class.ofCode</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.ofName">Class.ofName</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.ofValue">Class.ofValue</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Enum.html#.Class.values">Class.values</a></span></li><li class="nav-heading"><span class="nav-item-type type-namespace">N</span><span class="nav-item-name"><a href="Model.html">Model</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#assign">assign</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#clear">clear</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#clone">clone</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#equals">equals</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#generateId">generateId</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#isEmpty">isEmpty</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#normalize">normalize</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#normalizeField">normalizeField</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#toJSON">toJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#toJsonString">toJsonString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#validate">validate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#validateField">validateField</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#.Class.create">Class.create</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#.Class.createArray">Class.createArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#.Class.createPage">Class.createPage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#.Class.isNullishOrEmpty">Class.isNullishOrEmpty</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Model.html#.Class.parseJsonString">Class.parseJsonString</a></span></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#ElementType">ElementType</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Enumerable">Enumerable</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Label">Label</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#NameField">NameField</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#NonEmpty">NonEmpty</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#NonEnumerable">NonEnumerable</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Normalizable">Normalizable</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Nullable">Nullable</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Payload">Payload</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Readonly">Readonly</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Timeout">Timeout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Type">Type</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#Validatable">Validatable</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#assign">assign</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#create">create</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#createArray">createArray</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#createPage">createPage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#defaultNormalizer">defaultNormalizer</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#defaultValidator">defaultValidator</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#enumNormalizer">enumNormalizer</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isEnumClass">isEnumClass</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isEnumerator">isEnumerator</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isValidPageSource">isValidPageSource</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#normalize">normalize</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#stringifyId">stringifyId</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#toJSON">toJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#toJsonString">toJsonString</a></span></li>
|
|
28
|
+
</nav>
|
|
29
|
+
|
|
30
|
+
<div id="main">
|
|
31
|
+
|
|
32
|
+
<h1 class="page-title">Enum</h1>
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<section>
|
|
41
|
+
|
|
42
|
+
<header>
|
|
43
|
+
|
|
44
|
+
<h2>
|
|
45
|
+
Enum
|
|
46
|
+
</h2>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</header>
|
|
50
|
+
|
|
51
|
+
<article>
|
|
52
|
+
<div class="container-overview">
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<div class="description"><p>This decorator is used to decorate an enumeration class.</p>
|
|
56
|
+
<p>It must decorate a class.</p>
|
|
57
|
+
<p>An enumeration class is a class whose instances are enumerators. An enumerator
|
|
58
|
+
is an object with the following properties:</p>
|
|
59
|
+
<ul>
|
|
60
|
+
<li><code>value</code>:the value of the enumerator, which is exactly the name of the
|
|
61
|
+
static field of the enumeration class that corresponds to the enumerator.</li>
|
|
62
|
+
<li><code>name</code>: the display name of the enumerator, which could be specified
|
|
63
|
+
by the default string or object value of the static field of the
|
|
64
|
+
enumeration class that corresponds to the enumerator. It the default value
|
|
65
|
+
is not specified, the name of the enumerator is the same as its value.</li>
|
|
66
|
+
<li><code>i18n</code>: the i18n key of the enumerator, which is an optional property. It
|
|
67
|
+
could be specified by the default object value of the static field of the
|
|
68
|
+
enumeration class that corresponds to the enumerator. If this property is
|
|
69
|
+
specified, the <code>name</code> property will be transformed to a <code>getter</code>, which will
|
|
70
|
+
get the i18n value of the enumerator from the i18n resource bundle.</li>
|
|
71
|
+
<li><code>code</code>: the code of the enumerator, which is an optional property. It could
|
|
72
|
+
be specified by the default object value of the static field of the
|
|
73
|
+
enumeration class that corresponds to the enumerator.</li>
|
|
74
|
+
<li>other properties: other properties of the enumerator could be specified
|
|
75
|
+
by the default object value of the static field of the enumeration class
|
|
76
|
+
that corresponds to the enumerator.</li>
|
|
77
|
+
</ul>
|
|
78
|
+
<p>An enumerator also has the following prototype method:</p>
|
|
79
|
+
<ul>
|
|
80
|
+
<li><code>toString()</code>: returns the value of the enumerator.</li>
|
|
81
|
+
<li><code>toJSON()</code>: also returns the value of the enumerator.</li>
|
|
82
|
+
</ul>
|
|
83
|
+
<p>The enumeration class will have the following static methods:</p>
|
|
84
|
+
<ul>
|
|
85
|
+
<li><code>values()</code>: returns the array of all enumerators of this enumeration class.</li>
|
|
86
|
+
<li><code>ofValue(value): returns the enumerator whose value is </code>value<code>, or </code>undefined` if no such enumerator exists.</li>
|
|
87
|
+
<li><code>hasValue(value): returns </code>true<code>if there is an enumerator whose value is</code>value<code>, or </code>false` otherwise.</li>
|
|
88
|
+
<li><code>ofName(name): returns the enumerator whose name is </code>name<code>, or </code>undefined`
|
|
89
|
+
if no such enumerator exists.</li>
|
|
90
|
+
<li><code>hasName(name): returns </code>true<code>if there is an enumerator whose name is</code>name<code>, or </code>false` otherwise.</li>
|
|
91
|
+
<li><code>ofCode(code): returns the enumerator whose code is </code>code<code>, or </code>undefined`
|
|
92
|
+
if no such enumerator exists.</li>
|
|
93
|
+
<li><code>hasCode(code): returns </code>true<code>if there is an enumerator whose code is</code>code<code>, or </code>false` otherwise.</li>
|
|
94
|
+
<li>`of(expr): returns the enumerator corresponding to the specified expression.
|
|
95
|
+
The expression could be one of the following:
|
|
96
|
+
<ul>
|
|
97
|
+
<li>an enumerator of this enumeration class;</li>
|
|
98
|
+
<li>or the value of an enumerator of this enumeration class;</li>
|
|
99
|
+
<li>or the name of an enumerator of this enumeration class;</li>
|
|
100
|
+
<li>or the code of an enumerator of this enumeration class.</li>
|
|
101
|
+
</ul>
|
|
102
|
+
</li>
|
|
103
|
+
<li><code>has(value): returns </code>true<code>if there is an enumerator corresponding to the specified expression; or</code>false` otherwise. The expression could be one of
|
|
104
|
+
the following:
|
|
105
|
+
<ul>
|
|
106
|
+
<li>an enumerator of this enumeration class;</li>
|
|
107
|
+
<li>or the value of an enumerator of this enumeration class;</li>
|
|
108
|
+
<li>or the name of an enumerator of this enumeration class;</li>
|
|
109
|
+
<li>or the code of an enumerator of this enumeration class.</li>
|
|
110
|
+
</ul>
|
|
111
|
+
</li>
|
|
112
|
+
</ul>
|
|
113
|
+
<h5>Usage example:</h5>
|
|
114
|
+
<pre class="prettyprint source lang-js"><code>@Enum
|
|
115
|
+
class Gender {
|
|
116
|
+
static MALE = 'Male';
|
|
117
|
+
static FEMALE = 'Female';
|
|
118
|
+
}
|
|
119
|
+
</code></pre>
|
|
120
|
+
<p>The above code is equivalent to the following code:</p>
|
|
121
|
+
<pre class="prettyprint source lang-js"><code>class Gender {
|
|
122
|
+
static MALE = Object.freeze(new Gender('MALE', 'Male'));
|
|
123
|
+
|
|
124
|
+
static FEMALE = Object.freeze(new Gender('FEMALE', 'Female'));
|
|
125
|
+
|
|
126
|
+
static values() {
|
|
127
|
+
return [ Gender.MALE, Gender.FEMALE ];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static ofValue(value) {
|
|
131
|
+
switch (value) {
|
|
132
|
+
case 'MALE':
|
|
133
|
+
return Gender.MALE;
|
|
134
|
+
case 'FEMALE':
|
|
135
|
+
return Gender.FEMALE;
|
|
136
|
+
default:
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static hasValue(value) {
|
|
142
|
+
return Gender.ofValue(value) !== undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static ofName(name) {
|
|
146
|
+
return Gender.values().find((e) => e.name === name);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static hasName(name) {
|
|
150
|
+
return Gender.ofName(name) !== undefined;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static ofCode(code) {
|
|
154
|
+
return Gender.values().find((e) => e.code === code);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static hasCode(code) {
|
|
158
|
+
return Gender.ofCode(code) !== undefined;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static of(expr) {
|
|
162
|
+
if (expr instanceof Gender) {
|
|
163
|
+
return expr;
|
|
164
|
+
} else {
|
|
165
|
+
return Gender.ofValue(expr) ?? Gender.ofName(expr) ?? Gender.ofCode(expr);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
static has(expr) {
|
|
170
|
+
return Gender.of(expr) !== undefined;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
constructor(value, name) {
|
|
174
|
+
this.value = value;
|
|
175
|
+
this.name = name;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
toString() {
|
|
179
|
+
return this.value;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
toJSON() {
|
|
183
|
+
return this.value;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</code></pre>
|
|
187
|
+
<p>The static fields of the enumeration class could also be specified as objects,
|
|
188
|
+
which will be used to initialize the enumerators. For example:</p>
|
|
189
|
+
<pre class="prettyprint source lang-js"><code>@Enum
|
|
190
|
+
class Gender {
|
|
191
|
+
static MALE = { name: 'Male', i18n: 'i18n.gender.male', code: '001', data: { value: 0 } };
|
|
192
|
+
|
|
193
|
+
static FEMALE = { name: 'Female', i18n: 'i18n.gender.female', code: '002', data: { value: 1 } };
|
|
194
|
+
}
|
|
195
|
+
</code></pre>
|
|
196
|
+
<p>The above code is equivalent to the following code:</p>
|
|
197
|
+
<pre class="prettyprint source lang-js"><code>class Gender {
|
|
198
|
+
static MALE = Object.freeze(new Gender('MALE', 'Male',
|
|
199
|
+
{ i18n: 'i18n.gender.male', code: '001', data: {value: 0 } }));
|
|
200
|
+
|
|
201
|
+
static FEMALE = Object.freeze(new Gender('FEMALE', 'Female',
|
|
202
|
+
{ i18n: 'i18n.gender.female', code: '002', data: {value: 1 } }));
|
|
203
|
+
|
|
204
|
+
...
|
|
205
|
+
|
|
206
|
+
constructor(value, name, payload) {
|
|
207
|
+
this.value = value;
|
|
208
|
+
this.name = name;
|
|
209
|
+
Object.assign(this, payload);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
...
|
|
213
|
+
}
|
|
214
|
+
</code></pre>
|
|
215
|
+
<p>Note that the enumerator in the above <code>Gender</code> class has a <code>code</code>, <code>i18n</code>
|
|
216
|
+
and <code>data</code> properties. Since it has <code>i18n</code> property which specifies the i18n
|
|
217
|
+
key of the enumerator in the resource bundle, the <code>name</code> property of the
|
|
218
|
+
enumerator will be transformed to a <code>getter</code> which will get the i18n value
|
|
219
|
+
corresponding to the i18n key from the i18n resource bundle.</p>
|
|
220
|
+
<p>The enumerators can also be defined without default values, for example:</p>
|
|
221
|
+
<pre class="prettyprint source lang-js"><code>@Enum
|
|
222
|
+
class Gender {
|
|
223
|
+
static MALE;
|
|
224
|
+
static FEMALE;
|
|
225
|
+
}
|
|
226
|
+
</code></pre>
|
|
227
|
+
<p>The above code is equivalent to the following code:</p>
|
|
228
|
+
<pre class="prettyprint source lang-js"><code>class Gender {
|
|
229
|
+
static MALE = Object.freeze(new Gender('MALE'));
|
|
230
|
+
|
|
231
|
+
static FEMALE = Object.freeze(new Gender('FEMALE'));
|
|
232
|
+
|
|
233
|
+
...
|
|
234
|
+
|
|
235
|
+
constructor(value) {
|
|
236
|
+
this.value = value;
|
|
237
|
+
this.name = value;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
...
|
|
241
|
+
}
|
|
242
|
+
</code></pre>
|
|
243
|
+
<p>That is, the name of the enumerator is exactly its value.</p></div>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
<dl class="details">
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<dt class="tag-author">Author:</dt>
|
|
269
|
+
<dd class="tag-author">
|
|
270
|
+
<ul>
|
|
271
|
+
<li>Haixing Hu</li>
|
|
272
|
+
</ul>
|
|
273
|
+
</dd>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
</dl>
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
<h3 class="subsection-title">Methods</h3>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
<div class="section-method">
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
<h4 class="name" id=".Class.has"><span class="type-signature">(static) </span>Class.has<span class="signature">(expr)</span><span class="type-signature"> → {boolean}</span></h4>
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<div class="description">
|
|
326
|
+
<p>Tests whether there is an enumerator of this enumeration class corresponding
|
|
327
|
+
to the specified expression.</p>
|
|
328
|
+
<p>The expression could be one of the following:</p>
|
|
329
|
+
<ul>
|
|
330
|
+
<li>an enumerator of this enumeration class;</li>
|
|
331
|
+
<li>or the value of an enumerator of this enumeration class;</li>
|
|
332
|
+
<li>or the name of an enumerator of this enumeration class;</li>
|
|
333
|
+
<li>or the code of an enumerator of this enumeration class.</li>
|
|
334
|
+
</ul>
|
|
335
|
+
</div>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
<dl class="details">
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
<dt class="tag-author">Author:</dt>
|
|
361
|
+
<dd class="tag-author">
|
|
362
|
+
<ul>
|
|
363
|
+
<li>Haixing Hu</li>
|
|
364
|
+
</ul>
|
|
365
|
+
</dd>
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
</dl>
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
<h5>Parameters:</h5>
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
<table class="params">
|
|
395
|
+
<thead>
|
|
396
|
+
<tr>
|
|
397
|
+
|
|
398
|
+
<th>Name</th>
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
<th>Type</th>
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
<th class="last">Description</th>
|
|
408
|
+
</tr>
|
|
409
|
+
</thead>
|
|
410
|
+
|
|
411
|
+
<tbody>
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
<tr>
|
|
415
|
+
|
|
416
|
+
<td class="name"><code>expr</code></td>
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
<td class="type">
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
<span class="param-type"><code>object</code></span>
|
|
423
|
+
|
|
|
424
|
+
|
|
425
|
+
<span class="param-type"><code>string</code></span>
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
</td>
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
<td class="description last">
|
|
436
|
+
<p>The specified expression, which could be an enumerator object, the value
|
|
437
|
+
of an enumerator, the name of an enumerator, or the code of an enumerator.</p>
|
|
438
|
+
|
|
439
|
+
</td>
|
|
440
|
+
</tr>
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
</tbody>
|
|
444
|
+
</table>
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
<div class="section-returns">
|
|
462
|
+
<h5>Returns:</h5>
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
<dl class="param-type">
|
|
467
|
+
<dt>
|
|
468
|
+
Type:
|
|
469
|
+
</dt>
|
|
470
|
+
<dd>
|
|
471
|
+
|
|
472
|
+
<span class="param-type"><code>boolean</code></span>
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
</dd>
|
|
476
|
+
</dl>
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
<div class="param-desc">
|
|
480
|
+
<p><code>true</code> if there is an enumerator corresponding to the specified
|
|
481
|
+
enumerator, value, name or code; <code>false</code> otherwise.</p>
|
|
482
|
+
</div>
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
</div>
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
<div class="section-method">
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
<h4 class="name" id=".Class.hasCode"><span class="type-signature">(static) </span>Class.hasCode<span class="signature">(code)</span><span class="type-signature"> → {boolean}</span></h4>
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
<div class="description">
|
|
507
|
+
<p>Tests whether there is an enumerator of this enumeration class which has
|
|
508
|
+
the specified code.</p>
|
|
509
|
+
</div>
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<dl class="details">
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
<dt class="tag-author">Author:</dt>
|
|
535
|
+
<dd class="tag-author">
|
|
536
|
+
<ul>
|
|
537
|
+
<li>Haixing Hu</li>
|
|
538
|
+
</ul>
|
|
539
|
+
</dd>
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
</dl>
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
<h5>Parameters:</h5>
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
<table class="params">
|
|
569
|
+
<thead>
|
|
570
|
+
<tr>
|
|
571
|
+
|
|
572
|
+
<th>Name</th>
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
<th>Type</th>
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
<th class="last">Description</th>
|
|
582
|
+
</tr>
|
|
583
|
+
</thead>
|
|
584
|
+
|
|
585
|
+
<tbody>
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
<tr>
|
|
589
|
+
|
|
590
|
+
<td class="name"><code>code</code></td>
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
<td class="type">
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
<span class="param-type"><code>string</code></span>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
</td>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<td class="description last">
|
|
607
|
+
<p>The specified code. If the code is a primitive string or a <code>String</code>
|
|
608
|
+
object, it will be trimmed.</p>
|
|
609
|
+
|
|
610
|
+
</td>
|
|
611
|
+
</tr>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
</tbody>
|
|
615
|
+
</table>
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
<div class="section-returns">
|
|
633
|
+
<h5>Returns:</h5>
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
<dl class="param-type">
|
|
638
|
+
<dt>
|
|
639
|
+
Type:
|
|
640
|
+
</dt>
|
|
641
|
+
<dd>
|
|
642
|
+
|
|
643
|
+
<span class="param-type"><code>boolean</code></span>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
</dd>
|
|
647
|
+
</dl>
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
<div class="param-desc">
|
|
651
|
+
<p><code>true</code> if there is an enumerator of this enumeration class which has
|
|
652
|
+
the specified code; <code>false</code> otherwise.</p>
|
|
653
|
+
</div>
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
</div>
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
</div>
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
<div class="section-method">
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
<h4 class="name" id=".Class.hasName"><span class="type-signature">(static) </span>Class.hasName<span class="signature">(name)</span><span class="type-signature"> → {boolean}</span></h4>
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
<div class="description">
|
|
678
|
+
<p>Tests whether there is an enumerator of this enumeration class which has
|
|
679
|
+
the specified name.</p>
|
|
680
|
+
</div>
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
<dl class="details">
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
<dt class="tag-author">Author:</dt>
|
|
706
|
+
<dd class="tag-author">
|
|
707
|
+
<ul>
|
|
708
|
+
<li>Haixing Hu</li>
|
|
709
|
+
</ul>
|
|
710
|
+
</dd>
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
</dl>
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
<h5>Parameters:</h5>
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
<table class="params">
|
|
740
|
+
<thead>
|
|
741
|
+
<tr>
|
|
742
|
+
|
|
743
|
+
<th>Name</th>
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
<th>Type</th>
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
<th class="last">Description</th>
|
|
753
|
+
</tr>
|
|
754
|
+
</thead>
|
|
755
|
+
|
|
756
|
+
<tbody>
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
<tr>
|
|
760
|
+
|
|
761
|
+
<td class="name"><code>name</code></td>
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
<td class="type">
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
<span class="param-type"><code>string</code></span>
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
</td>
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
<td class="description last">
|
|
778
|
+
<p>The specified name. If the name is a primitive string or a <code>String</code>
|
|
779
|
+
object, it will be trimmed.</p>
|
|
780
|
+
|
|
781
|
+
</td>
|
|
782
|
+
</tr>
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
</tbody>
|
|
786
|
+
</table>
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
<div class="section-returns">
|
|
804
|
+
<h5>Returns:</h5>
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
<dl class="param-type">
|
|
809
|
+
<dt>
|
|
810
|
+
Type:
|
|
811
|
+
</dt>
|
|
812
|
+
<dd>
|
|
813
|
+
|
|
814
|
+
<span class="param-type"><code>boolean</code></span>
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
</dd>
|
|
818
|
+
</dl>
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
<div class="param-desc">
|
|
822
|
+
<p><code>true</code> if there is an enumerator of this enumeration class which has
|
|
823
|
+
the specified name; <code>false</code> otherwise.</p>
|
|
824
|
+
</div>
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
</div>
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
</div>
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
<div class="section-method">
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
<h4 class="name" id=".Class.hasValue"><span class="type-signature">(static) </span>Class.hasValue<span class="signature">(value)</span><span class="type-signature"> → {boolean}</span></h4>
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
<div class="description">
|
|
849
|
+
<p>Tests whether there is an enumerator of this enumeration class which has
|
|
850
|
+
the specified value.</p>
|
|
851
|
+
</div>
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
<dl class="details">
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
<dt class="tag-author">Author:</dt>
|
|
877
|
+
<dd class="tag-author">
|
|
878
|
+
<ul>
|
|
879
|
+
<li>Haixing Hu</li>
|
|
880
|
+
</ul>
|
|
881
|
+
</dd>
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
</dl>
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
<h5>Parameters:</h5>
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
<table class="params">
|
|
911
|
+
<thead>
|
|
912
|
+
<tr>
|
|
913
|
+
|
|
914
|
+
<th>Name</th>
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
<th>Type</th>
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
<th class="last">Description</th>
|
|
924
|
+
</tr>
|
|
925
|
+
</thead>
|
|
926
|
+
|
|
927
|
+
<tbody>
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
<tr>
|
|
931
|
+
|
|
932
|
+
<td class="name"><code>value</code></td>
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
<td class="type">
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
<span class="param-type"><code>string</code></span>
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
</td>
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
<td class="description last">
|
|
949
|
+
<p>The value of the enumerator to be tested. If the value is a primitive
|
|
950
|
+
string or a <code>String</code> object, it will be trimmed and converted to an
|
|
951
|
+
uppercase string.</p>
|
|
952
|
+
|
|
953
|
+
</td>
|
|
954
|
+
</tr>
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
</tbody>
|
|
958
|
+
</table>
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
<div class="section-returns">
|
|
976
|
+
<h5>Returns:</h5>
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
<dl class="param-type">
|
|
981
|
+
<dt>
|
|
982
|
+
Type:
|
|
983
|
+
</dt>
|
|
984
|
+
<dd>
|
|
985
|
+
|
|
986
|
+
<span class="param-type"><code>boolean</code></span>
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
</dd>
|
|
990
|
+
</dl>
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
<div class="param-desc">
|
|
994
|
+
<p><code>true</code> if there is an enumerator of this enumeration class which has
|
|
995
|
+
the specified value; <code>false</code> otherwise.</p>
|
|
996
|
+
</div>
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
</div>
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
</div>
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
<div class="section-method">
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
<h4 class="name" id=".Class.of"><span class="type-signature">(static) </span>Class.of<span class="signature">(expr)</span><span class="type-signature"> → {undefined|object}</span></h4>
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
<div class="description">
|
|
1021
|
+
<p>Returns the enumerator of this enumeration class corresponding to the
|
|
1022
|
+
specified expression.</p>
|
|
1023
|
+
<p>The expression could be one of the following:</p>
|
|
1024
|
+
<ul>
|
|
1025
|
+
<li>an enumerator of this enumeration class;</li>
|
|
1026
|
+
<li>or the value of an enumerator of this enumeration class;</li>
|
|
1027
|
+
<li>or the name of an enumerator of this enumeration class;</li>
|
|
1028
|
+
<li>or the code of an enumerator of this enumeration class.</li>
|
|
1029
|
+
</ul>
|
|
1030
|
+
</div>
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
<dl class="details">
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
<dt class="tag-author">Author:</dt>
|
|
1056
|
+
<dd class="tag-author">
|
|
1057
|
+
<ul>
|
|
1058
|
+
<li>Haixing Hu</li>
|
|
1059
|
+
</ul>
|
|
1060
|
+
</dd>
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
</dl>
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
<h5>Parameters:</h5>
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
<table class="params">
|
|
1090
|
+
<thead>
|
|
1091
|
+
<tr>
|
|
1092
|
+
|
|
1093
|
+
<th>Name</th>
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
<th>Type</th>
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
<th class="last">Description</th>
|
|
1103
|
+
</tr>
|
|
1104
|
+
</thead>
|
|
1105
|
+
|
|
1106
|
+
<tbody>
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
<tr>
|
|
1110
|
+
|
|
1111
|
+
<td class="name"><code>expr</code></td>
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
<td class="type">
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
<span class="param-type"><code>object</code></span>
|
|
1118
|
+
|
|
|
1119
|
+
|
|
1120
|
+
<span class="param-type"><code>string</code></span>
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
</td>
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
<td class="description last">
|
|
1131
|
+
<p>The specified value, which could be an enumerator object, the value of
|
|
1132
|
+
an enumerator, the name of an enumerator, or the code of an enumerator.</p>
|
|
1133
|
+
|
|
1134
|
+
</td>
|
|
1135
|
+
</tr>
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
</tbody>
|
|
1139
|
+
</table>
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
<div class="section-returns">
|
|
1157
|
+
<h5>Returns:</h5>
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
<dl class="param-type">
|
|
1162
|
+
<dt>
|
|
1163
|
+
Type:
|
|
1164
|
+
</dt>
|
|
1165
|
+
<dd>
|
|
1166
|
+
|
|
1167
|
+
<span class="param-type"><code>undefined</code></span>
|
|
1168
|
+
|
|
|
1169
|
+
|
|
1170
|
+
<span class="param-type"><code>object</code></span>
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
</dd>
|
|
1174
|
+
</dl>
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
<div class="param-desc">
|
|
1178
|
+
<p>The enumerator corresponding to the specified enumerator, value, name
|
|
1179
|
+
or code; or <code>undefined</code> if there is no such enumerator.</p>
|
|
1180
|
+
</div>
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
</div>
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
</div>
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
<div class="section-method">
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
<h4 class="name" id=".Class.ofCode"><span class="type-signature">(static) </span>Class.ofCode<span class="signature">(code)</span><span class="type-signature"> → {undefined|Class}</span></h4>
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
<div class="description">
|
|
1205
|
+
<p>Returns the enumerator of this enumeration class which has the specified
|
|
1206
|
+
code.</p>
|
|
1207
|
+
</div>
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
<dl class="details">
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
<dt class="tag-author">Author:</dt>
|
|
1233
|
+
<dd class="tag-author">
|
|
1234
|
+
<ul>
|
|
1235
|
+
<li>Haixing Hu</li>
|
|
1236
|
+
</ul>
|
|
1237
|
+
</dd>
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
</dl>
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
<h5>Parameters:</h5>
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
<table class="params">
|
|
1267
|
+
<thead>
|
|
1268
|
+
<tr>
|
|
1269
|
+
|
|
1270
|
+
<th>Name</th>
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
<th>Type</th>
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
<th class="last">Description</th>
|
|
1280
|
+
</tr>
|
|
1281
|
+
</thead>
|
|
1282
|
+
|
|
1283
|
+
<tbody>
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
<tr>
|
|
1287
|
+
|
|
1288
|
+
<td class="name"><code>code</code></td>
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
<td class="type">
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
<span class="param-type"><code>string</code></span>
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
</td>
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
<td class="description last">
|
|
1305
|
+
<p>The code of the enumerator to be returned. If the code is a primitive
|
|
1306
|
+
string or a <code>String</code> object, it will be trimmed.</p>
|
|
1307
|
+
|
|
1308
|
+
</td>
|
|
1309
|
+
</tr>
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
</tbody>
|
|
1313
|
+
</table>
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
<div class="section-returns">
|
|
1331
|
+
<h5>Returns:</h5>
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
<dl class="param-type">
|
|
1336
|
+
<dt>
|
|
1337
|
+
Type:
|
|
1338
|
+
</dt>
|
|
1339
|
+
<dd>
|
|
1340
|
+
|
|
1341
|
+
<span class="param-type"><code>undefined</code></span>
|
|
1342
|
+
|
|
|
1343
|
+
|
|
1344
|
+
<span class="param-type"><code>Class</code></span>
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
</dd>
|
|
1348
|
+
</dl>
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
<div class="param-desc">
|
|
1352
|
+
<p>The enumerator of this enumeration class which has the specified code;
|
|
1353
|
+
or <code>undefined</code> if there is no such enumerator.</p>
|
|
1354
|
+
</div>
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
</div>
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
</div>
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
<div class="section-method">
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
<h4 class="name" id=".Class.ofName"><span class="type-signature">(static) </span>Class.ofName<span class="signature">(name)</span><span class="type-signature"> → {undefined|Class}</span></h4>
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
<div class="description">
|
|
1379
|
+
<p>Returns the enumerator of this enumeration class which has the specified
|
|
1380
|
+
name.</p>
|
|
1381
|
+
</div>
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
<dl class="details">
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
|
|
1405
|
+
|
|
1406
|
+
<dt class="tag-author">Author:</dt>
|
|
1407
|
+
<dd class="tag-author">
|
|
1408
|
+
<ul>
|
|
1409
|
+
<li>Haixing Hu</li>
|
|
1410
|
+
</ul>
|
|
1411
|
+
</dd>
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
</dl>
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
<h5>Parameters:</h5>
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
<table class="params">
|
|
1441
|
+
<thead>
|
|
1442
|
+
<tr>
|
|
1443
|
+
|
|
1444
|
+
<th>Name</th>
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
<th>Type</th>
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
<th class="last">Description</th>
|
|
1454
|
+
</tr>
|
|
1455
|
+
</thead>
|
|
1456
|
+
|
|
1457
|
+
<tbody>
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
<tr>
|
|
1461
|
+
|
|
1462
|
+
<td class="name"><code>name</code></td>
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
<td class="type">
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
<span class="param-type"><code>string</code></span>
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
</td>
|
|
1473
|
+
|
|
1474
|
+
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
<td class="description last">
|
|
1479
|
+
<p>The name of the enumerator to be returned. If the name is a primitive
|
|
1480
|
+
string or a <code>String</code> object, it will be trimmed.</p>
|
|
1481
|
+
|
|
1482
|
+
</td>
|
|
1483
|
+
</tr>
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
</tbody>
|
|
1487
|
+
</table>
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
<div class="section-returns">
|
|
1505
|
+
<h5>Returns:</h5>
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
<dl class="param-type">
|
|
1510
|
+
<dt>
|
|
1511
|
+
Type:
|
|
1512
|
+
</dt>
|
|
1513
|
+
<dd>
|
|
1514
|
+
|
|
1515
|
+
<span class="param-type"><code>undefined</code></span>
|
|
1516
|
+
|
|
|
1517
|
+
|
|
1518
|
+
<span class="param-type"><code>Class</code></span>
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
</dd>
|
|
1522
|
+
</dl>
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
<div class="param-desc">
|
|
1526
|
+
<p>The enumerator of this enumeration class which has the specified name;
|
|
1527
|
+
or <code>undefined</code> if there is no such enumerator.</p>
|
|
1528
|
+
</div>
|
|
1529
|
+
|
|
1530
|
+
|
|
1531
|
+
</div>
|
|
1532
|
+
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
</div>
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
<div class="section-method">
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
<h4 class="name" id=".Class.ofValue"><span class="type-signature">(static) </span>Class.ofValue<span class="signature">(value)</span><span class="type-signature"> → {undefined|Class}</span></h4>
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
|
|
1552
|
+
<div class="description">
|
|
1553
|
+
<p>Returns the enumerator of this enumeration class which has the specified
|
|
1554
|
+
value.</p>
|
|
1555
|
+
</div>
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
|
|
1561
|
+
<dl class="details">
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
<dt class="tag-author">Author:</dt>
|
|
1581
|
+
<dd class="tag-author">
|
|
1582
|
+
<ul>
|
|
1583
|
+
<li>Haixing Hu</li>
|
|
1584
|
+
</ul>
|
|
1585
|
+
</dd>
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
</dl>
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
<h5>Parameters:</h5>
|
|
1612
|
+
|
|
1613
|
+
|
|
1614
|
+
<table class="params">
|
|
1615
|
+
<thead>
|
|
1616
|
+
<tr>
|
|
1617
|
+
|
|
1618
|
+
<th>Name</th>
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
<th>Type</th>
|
|
1622
|
+
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
<th class="last">Description</th>
|
|
1628
|
+
</tr>
|
|
1629
|
+
</thead>
|
|
1630
|
+
|
|
1631
|
+
<tbody>
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
<tr>
|
|
1635
|
+
|
|
1636
|
+
<td class="name"><code>value</code></td>
|
|
1637
|
+
|
|
1638
|
+
|
|
1639
|
+
<td class="type">
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
<span class="param-type"><code>string</code></span>
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
</td>
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
<td class="description last">
|
|
1653
|
+
<p>The value of the enumerator to be returned. If the value is a primitive
|
|
1654
|
+
string or a <code>String</code> object, it will be trimmed and converted to an
|
|
1655
|
+
uppercase string.</p>
|
|
1656
|
+
|
|
1657
|
+
</td>
|
|
1658
|
+
</tr>
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
</tbody>
|
|
1662
|
+
</table>
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
<div class="section-returns">
|
|
1680
|
+
<h5>Returns:</h5>
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
|
|
1684
|
+
<dl class="param-type">
|
|
1685
|
+
<dt>
|
|
1686
|
+
Type:
|
|
1687
|
+
</dt>
|
|
1688
|
+
<dd>
|
|
1689
|
+
|
|
1690
|
+
<span class="param-type"><code>undefined</code></span>
|
|
1691
|
+
|
|
|
1692
|
+
|
|
1693
|
+
<span class="param-type"><code>Class</code></span>
|
|
1694
|
+
|
|
1695
|
+
|
|
1696
|
+
</dd>
|
|
1697
|
+
</dl>
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
<div class="param-desc">
|
|
1701
|
+
<p>The enumerator of this enumeration class which has the specified value;
|
|
1702
|
+
or <code>undefined</code> if there is no such enumerator.</p>
|
|
1703
|
+
</div>
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
</div>
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
|
+
</div>
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
<div class="section-method">
|
|
1716
|
+
|
|
1717
|
+
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
<h4 class="name" id=".Class.values"><span class="type-signature">(static) </span>Class.values<span class="signature">()</span><span class="type-signature"> → {Array.<object>}</span></h4>
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
|
|
1726
|
+
|
|
1727
|
+
<div class="description">
|
|
1728
|
+
<p>Returns the array of all enumerators of this enumeration class.</p>
|
|
1729
|
+
</div>
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
|
|
1735
|
+
<dl class="details">
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
</dl>
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
|
|
1792
|
+
<div class="section-returns">
|
|
1793
|
+
<h5>Returns:</h5>
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
<dl class="param-type">
|
|
1798
|
+
<dt>
|
|
1799
|
+
Type:
|
|
1800
|
+
</dt>
|
|
1801
|
+
<dd>
|
|
1802
|
+
|
|
1803
|
+
<span class="param-type"><code>Array.<object></code></span>
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
</dd>
|
|
1807
|
+
</dl>
|
|
1808
|
+
|
|
1809
|
+
|
|
1810
|
+
<div class="param-desc">
|
|
1811
|
+
<p>The array of all enumerators of this enumeration class.</p>
|
|
1812
|
+
</div>
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
</div>
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
</div>
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
|
|
1828
|
+
</article>
|
|
1829
|
+
|
|
1830
|
+
</section>
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
</div>
|
|
1836
|
+
|
|
1837
|
+
<br class="clear">
|
|
1838
|
+
|
|
1839
|
+
<footer>
|
|
1840
|
+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a>
|
|
1841
|
+
on Mon Jan 06 2025 12:25:48 GMT+0800 (China Standard Time)
|
|
1842
|
+
using the <a href="https://github.com/Haixing-Hu/jsdoc-minami">customized Minami theme</a>.
|
|
1843
|
+
</footer>
|
|
1844
|
+
|
|
1845
|
+
<script>prettyPrint();</script>
|
|
1846
|
+
<script src="scripts/linenumber.js"></script>
|
|
1847
|
+
</body>
|
|
1848
|
+
</html>
|