Section 2.2.3.2 Enumeration Definitions


The structure of an enumeration is much simpler: four components are included, with the last one being optional.

1 SupertypeSince all enumerations are subtypes of Enumeration, the supertype (i.e., superclass) is always Enumeration. Since Enumeration is part of the SAIF standard, the associated schema name is not specified.

2 enumeration nameNext comes the name of the enumeration which is currently being defined, including the name of the schema to which it belongs. (If the enumeration is part of the SAIF standard schema, the schema name is not provided.) As with class names, enumeration names should be meaningful.

3 tagA SAIF profile or encoding scheme may require that each type have a unique tag, as discussed earlier. This applies to enumerations as well as classes.

4 valuesThe n enumerates contained within the enumeration are listed. Each of these consists of a one word textual description followed by a numeric value. The default numeric values are 0 through n-1. In the typical situation, where the user has no interest in the numeric values, they are not provided, and it is assumed that the defaults apply. For example, PrimaryColor consists of: blue green red. If the user wants certain integer values associated with the descriptions, these may be provided in parentheses following each description. PrimaryColor might be defined as blue (2) green (5) red (7). This may be of interest if it is desired to match some pre-existing numbering system.

5 commentsComments concerning the particular meanings of the values in the description may be provided, as well as any other relevant remarks.


Links to the SAIF 3.1 Specification document and the complete SAIF class list