Difference between revisions of "XCSG:Enumeration"

From AtlasWiki
Jump to: navigation, search
(Created page with "The semantics of Enumeration are those common to UML [5, pp. 2-39, 2-68] and MS-IL [27, p. 143]. The semantics of EnumerationLiteral are those defined by UML [5, pp. 2-39, 2-...")
 
Line 18: Line 18:
 
| [5, pp. 2-39, 2-68, 3-57, 6-8, 6-38], [5, B-8, enumeration], enumeration type [27, p. 143]
 
| [5, pp. 2-39, 2-68, 3-57, 6-8, 6-38], [5, B-8, enumeration], enumeration type [27, p. 143]
 
|}
 
|}
 
  
 
== Language mappings ==
 
== Language mappings ==

Revision as of 15:24, 5 March 2014

The semantics of Enumeration are those common to UML [5, pp. 2-39, 2-68] and MS-IL [27, p. 143].

The semantics of EnumerationLiteral are those defined by UML [5, pp. 2-39, 2-65].

Specifications

Metaclass Enumeration
Extends DataType
Description A datatype whose range consists of a set of predefined values, called enumeration literals
References [5, pp. 2-39, 2-68, 3-57, 6-8, 6-38], [5, B-8, enumeration], enumeration type [27, p. 143]

Language mappings

In C++, an enum declaration creates a distinct integer type with named constants (literals). The names of the enumeration literals must be distinct, and the only operation defined for enumerated data types is assignment [50, p. 17].

Enumeration literals can be mapped to named constants in languages that do not support enumeration types (such as Java).