Note: Please do not use or modify any data or functions with a leading underscore. More...
Public Member Functions | |
def | __call__ (self, key) |
def | __init__ (self, names, prefix='', asInt=False, intOffset=0) |
def | __setattr__ (self, name, value) |
def | isValidKey (self, key) |
def | isValidValue (self, value) |
def | keys (self) |
def | valueToKey (self, value) |
Private Attributes | |
_keys | |
_valueDict | |
Note: Please do not use or modify any data or functions with a leading underscore.
If you "mess" with the internal structure, the classes may not function as intended.
Similar to C++'s 'enum', but with a few extra toys. Takes a string with spaces in between the different 'enum' names (keys). If 'asInt' is true, then values will be integers (useful for array indicies). Once created, the enum values can not be changed.
Definition at line 7 of file Enumerate.py.
def Enumerate.Enumerate.__init__ | ( | self, | |
names, | |||
prefix = '' , |
|||
asInt = False , |
|||
intOffset = 0 |
|||
) |
Definition at line 13 of file Enumerate.py.
def Enumerate.Enumerate.__call__ | ( | self, | |
key | |||
) |
Definition at line 62 of file Enumerate.py.
def Enumerate.Enumerate.__setattr__ | ( | self, | |
name, | |||
value | |||
) |
Lets me set internal values, but throws an error if any of the enum values are changed
Definition at line 52 of file Enumerate.py.
Referenced by GenObject.GenObject.setValue().
def Enumerate.Enumerate.isValidKey | ( | self, | |
key | |||
) |
Returns true if this value is a valid enum key
Definition at line 35 of file Enumerate.py.
def Enumerate.Enumerate.isValidValue | ( | self, | |
value | |||
) |
Returns true if this value is a valid enum value
Definition at line 30 of file Enumerate.py.
References Enumerate.Enumerate._valueDict.
def Enumerate.Enumerate.keys | ( | self | ) |
Returns copy of valid keys
Definition at line 45 of file Enumerate.py.
References Enumerate.Enumerate._keys.
Referenced by psClasses.queueList.__init__(), psClasses.queueList.smallestQueue(), and psClasses.queueList.thinerQueue().
def Enumerate.Enumerate.valueToKey | ( | self, | |
value | |||
) |
Returns the key (if it exists) for a given enum value
Definition at line 40 of file Enumerate.py.
References Enumerate.Enumerate._valueDict.
|
private |
Definition at line 15 of file Enumerate.py.
Referenced by Enumerate.Enumerate.keys().
|
private |
Definition at line 16 of file Enumerate.py.
Referenced by Enumerate.Enumerate.isValidValue(), and Enumerate.Enumerate.valueToKey().