new EnumType(parameters)
- Description:
Specifies a enumeration type, i.e. an unordered non-repetitive enumeration of elements.
Extends: Type. This class extends Type, with all public methods available.
Type parameters
General parameter
name: ...
The type name. Required field.itemType: ...
The type elements around the prototypes, used to project onto the prototypes.- By default, "value", means any value, and the default value is undefined.
values: ...
The enumeration of the prototypes defining this type.- The first value is the
default
value, i.e., the value as closed as possible to an undefined value. - Each value is semantically projected on the item data type to guaranty the coherence of the operations.
- The first value is the
EnumType specification
Syntactic projection - The syntactic projection is delegated to the item type. Semantic projection - The semantic projection corresponds of choosing the value of minimal distance with respect to the item type. Distance value - The minimal distance computation is delegated to the item type and applied on each value of value set, selecting the minimal distance.
- The complexity order of magnitude is thus linear with respect to the enumeration length considering the item type complexity as basic operation.Geodesic path - The geodesic calculation is delegated to the item type. Comparison - The comparison is delegated to the item type. Bounds - The values are also the bounds for this type.
Parameters:
Name | Type | Description |
---|---|---|
parameters |
JSON | String | The type parameters. |
Methods
getInterpolatedValue(value, parameters) → {Value}
- Description:
Interpolates a value with respect to one of the enumerated prototypes.
Parameters:
Name | Type | Description |
---|---|---|
value |
JSON | The input value. |
parameters |
JSON | The interpolation parameters.
|
Returns:
The interpolated value.
- Type
- Value