Documentation Language: Swift

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

?
init(id:name:literals:eAnnotations:)

Creates a new enumeration.

?
init(object:shouldIgnoreUnresolvedLiterals:)

Initialise an EEnum from a DynamicEObject.

Instance Properties

V
eAnnotations

Annotations attached to this enum.

V
eClass

The metaclass describing this enum.

V
id

Unique identifier for this enum.

V
literals

The literals (named values) in this enum.

V
name

The name of this enum.

Instance Methods

F
eGet(_:)

Reflectively retrieves the value of a feature.

F
eIsSet(_:)

Checks whether a feature has been explicitly set.

F
eSet(_:_:)

Reflectively sets the value of a feature.

F
eUnset(_:)

Unsets a feature, returning it to its default value.

F
getLiteral(name:)

Retrieves a literal by its name.

F
getLiteral(value:)

Retrieves a literal by its integer value.

F
hash(into:)

Hashes the essential components of this enumeration.

Type Aliases

T
EEnum.Classifier

The type of classifier for this enum.

Default Implementations

Relationships

Conforms To

See Also

Classifiers

P
EClassifier

A classifier (type) in the Ecore metamodel.

S
EDataType

A data type in the Ecore metamodel.

S
EEnumLiteral

A literal value within an enumeration.