This class emulates a C-like enum for python. More...

Public Member Functions | |
| def | __init__ |
| Canonical constructor. More... | |
| def | contains |
| Return true if this enumerate contains the specified key string. More... | |
| def | isValid |
| Returns true if the specified integer value is defined as an identifier in this enumarate. More... | |
| def | listkeys |
| Returns the list of keys in this enumerate. More... | |
| def | listvalues |
| Returns the list of values specified to initiate this enumerate. More... | |
| def | keyOf |
| Returns the symbolic key string associated to the specified identifier value. More... | |
This class emulates a C-like enum for python.
It is initialized with a list of strings to be used as the enum symbolic keys. The enum values are automatically generated as sequencing integer starting at the specified offset value.
| def enumerate.Enumerate.__init__ | ( | self, | |
| keys, | |||
offset = 0 |
|||
| ) |
Canonical constructor.
| keys | a list of string to be used as the enum symbolic keys. The enum values are automatically generated as a sequence of integers starting at the specified offset value. |
| def enumerate.Enumerate.contains | ( | self, | |
| key | |||
| ) |
Return true if this enumerate contains the specified key string.
| key | a key string to test |
| def enumerate.Enumerate.isValid | ( | self, | |
| value | |||
| ) |
Returns true if the specified integer value is defined as an identifier in this enumarate.
| value | a value to test |
| def enumerate.Enumerate.listkeys | ( | self | ) |
Returns the list of keys in this enumerate.
| def enumerate.Enumerate.listvalues | ( | self | ) |
Returns the list of values specified to initiate this enumerate.
| def enumerate.Enumerate.keyOf | ( | self, | |
| value | |||
| ) |
Returns the symbolic key string associated to the specified identifier value.
| value | an integer value whose associated key string is requested. |