Version: 8.3.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
enumerate.Enumerate Class Reference

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

Inheritance diagram for enumerate.Enumerate:
Inheritance graph

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

def enumerate.Enumerate.__init__ (   self,
  keys,
  offset = 0 
)

Canonical constructor.

Parameters
keysa 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.

Member Function Documentation

def enumerate.Enumerate.contains (   self,
  key 
)

Return true if this enumerate contains the specified key string.

Parameters
keya 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.

Parameters
valuea 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.

Parameters
valuean integer value whose associated key string is requested.