Enumeration Definition
Enumerations
noreferences

@@description

<p>
The Umple language allows developers to define enumerations for either a single class, or to share between classes.
An enumeration is a user-defined data type that is a set of constants.
</p>

<p>
As shown in the examples below, enumerations require the keyword "enum" followed by the name of the enumeration, and its values.
If duplicate enumerations are detected, <a href="E095DuplicateEnumerations.html">E095 Duplicate Enumerations</a> will be raised.
If enumerations outside of class bodies have the same name as the enumerations within class bodies, the enumerations within class bodies will be used in 
the generated code.
</p>

<p>
Model-level enumerations will be added to classes when they do not already have enumerations defined with the same name, and the enumeration is detected in attribute types, method return types, method parameter types, and/or event parameter types.
</p>

@@syntax
[[enumerationDefinition]]

@@example
@@source manualexamples/EnumerationDefinition1.ump
@@endexample

@@example @@caption Example of Enumeration Shared by Two Different Classes @@endcaption
@@source manualexamples/EnumerationDefinition2.ump
@@endexample


@@example @@caption Example of Enumerations Defined for a Single Class or Shared between Different Classes @@endcaption
@@source manualexamples/EnumerationDefinition3.ump
@@endexample

@@example @@caption Example with Enumerations Defined Within and Outside of Class Bodies @@endcaption
@@source manualexamples/EnumerationDefinition4.ump
@@endexample
