Structure
EEnum
An enumeration type in the Ecore metamodel.
struct EEnum
Overview
EEnum represents enumerated types with a fixed set of named values, similar to Swift enums or Java enums.
Each enum contains a collection of EEnumLiteral values that define the valid values for attributes of this type.
Example
let birdType = EEnum(
name: "BirdType",
literals: [
EEnumLiteral(name: "blackbird", value: 0),
EEnumLiteral(name: "thrush", value: 1),
EEnumLiteral(name: "bluebird", value: 2)
]
)
// Look up literal by name
let literal = birdType.getLiteral(name: "thrush")
print(literal?.value) // 1
Topics
Operators
Compares two enumerations for equality.
Initializers
Creates a new enumeration.
Initialise an EEnum from a DynamicEObject.
Instance Properties
Annotations attached to this enum.
The metaclass describing this enum.
Unique identifier for this enum.
The literals (named values) in this enum.
The name of this enum.
Instance Methods
Reflectively retrieves the value of a feature.
Checks whether a feature has been explicitly set.
Reflectively sets the value of a feature.
Unsets a feature, returning it to its default value.
Retrieves a literal by its name.
Retrieves a literal by its integer value.
Hashes the essential components of this enumeration.
Type Aliases
The type of classifier for this enum.
Default Implementations
Relationships
Conforms To
See Also
Classifiers
A classifier (type) in the Ecore metamodel.
A data type in the Ecore metamodel.
A literal value within an enumeration.