enumeration

A data type whose instances form a list of named literal values. Usually, both the enumeration name and its literal values are declared.

See also classifier, data type.

Semantics

An enumeration is a user-definable data type. It has a name and an ordered list of enumeration literal values, each of which is a value in the range of the data type—that is, it is a predefined instance of the data type.

For example, RGBColor = {red, green, blue}, in which the data type is RGBColor and its possible values are red, green, and blue. The data type Boolean is a predefined enumeration with the literals false and true.

Enumeration literals can be compared for equality or for relative position in the list of literals. They are atomic and have no ...

Get Unified Modeling Language Reference Manual, The, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.