Previous UML Classes Table of Contents UML Packages Next

7.3.16 Enumeration


   An enumeration is a data type whose values are enumerated in the model as enumeration literals.



    DataType (from Kernel ) on page 60


   Enumeration is a kind of data type, whose instances may be any of a number of user-defined enumeration literals. It is possible to extend the set of applicable enumeration literals in other packages or profiles.


   No additional attributes


ownedLiteral: EnumerationLiteral [*] The ordered set of literals for this Enumeration. Subsets


   No additional constraints


   The run-time instances of an Enumeration are data values. Each such value corresponds to exactly one EnumerationLiteral .


   An enumeration may be shown using the classifier notation (a rectangle) with the keyword «enumeration». The name of the enumeration is placed in the upper compartment. A compartment listing the attributes for the enumeration is placed below the name compartment. A compartment listing the operations for the enumeration is placed below the attribute compartment. A list of enumeration literals may be placed, one to a line, in the bottom compartment. The attributes and operations compartments may be suppressed, and typically are suppressed if they would be empty.


Figure 7.41 - Example of an enumeration

«enumeration» VisibilityKind

public private protected