company logo

Enumeration

An enumeration is a simple classification. It defines a number of categories by its name and a number of associated codes (numerical values). Enumerations are based on numerical values, always.

Since categories may generate new classes and thus, new object types, each category in an enumeration can be associated with a type (structure). In this case, the enumeration must define the base type (base structure) for all object types generated by categories of the enumeration. An enumeration for { 0: male, 1: female} based on Person may generate classes for each category as Man and Woman.

An enumeration for { 0: male, 1: female} based on Person may generate classes for each category as Man and Woman.