Table of Contents

Class: State state.py

The container of all state variables.

Methods   
__init__
add
getAllNames
getAllVars
getStateVar
getValue
isDef
remove
setValue
size
  __init__ 
__init__ ( self )

Constructs an empty state.

  add 
add ( self,  statevar )

Adds a state variable object to the state. If a state variable with the same name already exists, the old StateVar object is replaced by the new one.

  getAllNames 
getAllNames ( self )

Returns a list of all StateVar names as strings.

  getAllVars 
getAllVars ( self )

Returns a list of all StateVar objects.

  getStateVar 
getStateVar ( self,  name )

Returns the StateVar object with name name. If not found, a KeyError is thrown.

  getValue 
getValue ( self,  name )

Returns the value of the variable with the specified name. If not found, a KeyError is thrown.

  isDef 
isDef ( self,  name )

Returns 1 if there is a state variable with the specified name. Otherwise, returns 0.

  remove 
remove ( self,  var )

Removes a state variable. If not found, a KeyError is thrown.

  setValue 
setValue (
        self,
        name,
        value,
        )

Sets the StateVar specified by name to the given value. If no variables have name name, a KeyError is thrown.

  size 
size ( self )

Returns the number of variables in the state.


Table of Contents

This document was automatically generated on Thu Dec 20 18:40:47 2001 by HappyDoc version r1_6_1