Peach :: group :: GroupFixed :: Class GroupFixed
[hide private]

Class GroupFixed

source code


Group object with a fixed number of iterations.

Instance Methods [hide private]
 
__init__(self, maxIterations=0)
Create GroupFixed object.
source code
number @return the maximum iterations
getMaxIterations(self)
Get the maximum iterations to perform.
source code
 
setMaxIterations(self, maxIterations)
Set the maximum iterations to perform.
source code
 
next(self)
Iterate all Generators to next value.
source code

Inherited from Group: __iter__, addGenerator, addGenerators, getAllGenerators, getName, removeGenerator, reset, setName

Class Variables [hide private]
  _max = 0
  _current = 0

Inherited from Group (private): _generators, _identity, _name

Method Details [hide private]

__init__(self, maxIterations=0)
(Constructor)

source code 

Create GroupFixed object.

Parameters:
  • maxIterations (number) - Maximum number of iterations.
Overrides: Group.__init__

setMaxIterations(self, maxIterations)

source code 

Set the maximum iterations to perform.

Parameters:
  • maxIterations (number) - Maximum number of iterations.

next(self)

source code 

Iterate all Generators to next value.

From Python docs on next():

The intention of the protocol is that once an iterator's next() method raises StopIteration, it will continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. (This constraint was added in Python 2.3; in Python 2.2, various iterators are broken according to this rule.)

For Groups, please use the GroupCompleted exception instead of StopIteration (its a subclass).

Overrides: Group.next
(inherited documentation)