The Assimilation Monitoring Project
cma::AssimCtypes::MutableString Class Reference
Inheritance diagram for cma::AssimCtypes::MutableString:
Collaboration diagram for cma::AssimCtypes::MutableString:

Public Member Functions

def __init__
def __hash__
def __setitem__
def __delitem__
def __setslice__
def __delslice__
def immutable
def __iadd__
def __imul__

Data Fields

 data

Detailed Description

mutable string objects

Python strings are immutable objects.  This has the advantage, that
strings may be used as dictionary keys.  If this property isn't needed
and you insist on changing string values in place instead, you may cheat
and use MutableString.

But the purpose of this class is an educational one: to prevent
people from inventing their own mutable string class derived
from UserString and than forget thereby to remove (override) the
__hash__ method inherited from UserString.  This would lead to
errors that would be very hard to track down.

A faster and better solution is to rewrite your program using lists.

Definition at line 169 of file AssimCtypes.py.


Constructor & Destructor Documentation

def cma::AssimCtypes::MutableString::__init__ (   self,
  string = "" 
)

Reimplemented from cma::AssimCtypes::UserString.

Reimplemented in cma::AssimCtypes::String.

Definition at line 184 of file AssimCtypes.py.


Member Function Documentation

def cma::AssimCtypes::MutableString::__delitem__ (   self,
  index 
)

Definition at line 193 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::__delslice__ (   self,
  start,
  end 
)

Definition at line 206 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::__hash__ (   self)

Reimplemented from cma::AssimCtypes::UserString.

Definition at line 186 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::__iadd__ (   self,
  other 
)

Definition at line 211 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::__imul__ (   self,
  n 
)

Definition at line 219 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::__setitem__ (   self,
  index,
  sub 
)

Definition at line 188 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::__setslice__ (   self,
  start,
  end,
  sub 
)

Definition at line 198 of file AssimCtypes.py.

def cma::AssimCtypes::MutableString::immutable (   self)

Definition at line 209 of file AssimCtypes.py.


Field Documentation

Reimplemented from cma::AssimCtypes::UserString.

Reimplemented in cma::AssimCtypes::String.

Definition at line 184 of file AssimCtypes.py.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines