Patent ID: 7263687

Claim:
A method for facilitating compilation and use of an object-oriented enumerated type within a computer program, comprising: receiving source code for the computer program, wherein the source code contains a declaration for an enumerated type; wherein the declaration specifies a fixed number of enumeration constants that comprise the enumerated type, wherein the computer automatically generates the enumerated type comprising a class defined within an object oriented programming language, wherein the class includes a self-typed constant for each enumeration constant specified in the declaration and includes methods for operating on those constants; defining the enumerated type using a class defined within an object-oriented programming language, wherein the class includes a self-typed constant for each enumeration constant specified in the declaration; and if the source code specifies a multi-way branch statement associated with the enumerated type, implementing the multi-way branch statement as a switch statement so that different enumeration constants are associated with different cases of the switch statement.