OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 library engine.utilities.dart; | 3 library engine.utilities.dart; |
4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
5 /** | 5 /** |
6 * The enumeration `ParameterKind` defines the different kinds of parameters. Th
ere are two | 6 * The enumeration `ParameterKind` defines the different kinds of parameters. Th
ere are two |
7 * basic kinds of parameters: required and optional. Optional parameters are fur
ther divided into | 7 * basic kinds of parameters: required and optional. Optional parameters are fur
ther divided into |
8 * two kinds: positional optional and named optional. | 8 * two kinds: positional optional and named optional. |
9 * | 9 * |
10 * @coverage dart.engine.utilities | 10 * @coverage dart.engine.utilities |
11 */ | 11 */ |
12 class ParameterKind implements Enum<ParameterKind> { | 12 class ParameterKind extends Enum<ParameterKind> { |
13 static final ParameterKind REQUIRED = new ParameterKind('REQUIRED', 0, false); | 13 static final ParameterKind REQUIRED = new ParameterKind('REQUIRED', 0, false); |
14 static final ParameterKind POSITIONAL = new ParameterKind('POSITIONAL', 1, tru
e); | 14 static final ParameterKind POSITIONAL = new ParameterKind('POSITIONAL', 1, tru
e); |
15 static final ParameterKind NAMED = new ParameterKind('NAMED', 2, true); | 15 static final ParameterKind NAMED = new ParameterKind('NAMED', 2, true); |
16 static final List<ParameterKind> values = [REQUIRED, POSITIONAL, NAMED]; | 16 static final List<ParameterKind> values = [REQUIRED, POSITIONAL, NAMED]; |
17 | 17 |
18 /// The name of this enum constant, as declared in the enum declaration. | |
19 final String name; | |
20 | |
21 /// The position in the enum declaration. | |
22 final int ordinal; | |
23 | |
24 /** | 18 /** |
25 * A flag indicating whether this is an optional parameter. | 19 * A flag indicating whether this is an optional parameter. |
26 */ | 20 */ |
27 bool _isOptional2 = false; | 21 bool _isOptional2 = false; |
28 | 22 |
29 /** | 23 /** |
30 * Initialize a newly created kind with the given state. | 24 * Initialize a newly created kind with the given state. |
31 * | 25 * |
32 * @param isOptional `true` if this is an optional parameter | 26 * @param isOptional `true` if this is an optional parameter |
33 */ | 27 */ |
34 ParameterKind(this.name, this.ordinal, bool isOptional) { | 28 ParameterKind(String name, int ordinal, bool isOptional) : super(name, ordinal
) { |
35 this._isOptional2 = isOptional; | 29 this._isOptional2 = isOptional; |
36 } | 30 } |
37 | 31 |
38 /** | 32 /** |
39 * Return `true` if this is an optional parameter. | 33 * Return `true` if this is an optional parameter. |
40 * | 34 * |
41 * @return `true` if this is an optional parameter | 35 * @return `true` if this is an optional parameter |
42 */ | 36 */ |
43 bool get isOptional => _isOptional2; | 37 bool get isOptional => _isOptional2; |
44 int compareTo(ParameterKind other) => ordinal - other.ordinal; | |
45 int get hashCode => ordinal; | |
46 String toString() => name; | |
47 } | 38 } |
OLD | NEW |