Package pyxb :: Package utils :: Module fac :: Class UpdateInstruction |
[hide private]
[frames] | no frames]

# classobj UpdateInstruction

source code

An update instruction pairs a counter with a mutation of that counter.

The instruction is executed during a transition from one state to another, and causes the corresponding counter to be incremented or reset. The instruction may only be applied if doing so does not violate the conditions of the counter it affects.

Instance Methods | [hide private]
__get_counterCondition(self) A reference to the CounterCondition identifying the counter to be updated. | source code
__get_doIncrement(self) `True` if the counter is to be incremented; `False` if it is to be reset. | source code
__init__(self, counter_condition, do_increment) Create an update instruction. | source code
satisfiedBy(self, counter_values) Implement a component of definition 5 from HOV09. | source code
apply(self, counter_values) Apply the update instruction to the provided counter values. | source code
__hash__(self) | source code
__eq__(self, other) | source code
__ne__(self, other) | source code
__str__(self) | source code

Class Methods | [hide private]
Satisfies(cls, counter_values, update_instructions) Return `True` iff the counter values satisfy the update instructions. | source code
Apply(cls, update_instructions, counter_values) Apply the update instructions to the counter values. | source code

Class Variables | [hide private]
| __counterCondition = `None`
| __doIncrement = `None`
| __min = `None`
| __max = `None`

Properties | [hide private]
| counterCondition A reference to the CounterCondition identifying the counter to be updated.
| doIncrement `True` if the counter is to be incremented; `False` if it is to be reset.

Method Details | [hide private]

### __get_counterCondition(self) | source code
A reference to the CounterCondition identifying the counter to be updated. The counter condition instance is used as a key to the dictionary maintaining current counter values.

### __init__(self, counter_condition, do_increment) (Constructor) | source code
Create an update instruction. Parameters: `counter_condition` - A CounterCondition identifying a minimum and maximum value for a counter, and serving as a map key for the value of the corresponding counter. `do_increment` - `True` if the update is to increment the value of the counter; `False` if the update is to reset the counter.

### satisfiedBy(self, counter_values) | source code
Implement a component of definition 5 from HOV09. The update instruction is satisfied by the counter values if its action may be legitimately applied to the value of its associated counter. Parameters: `counter_values` - A map from CounterConditions to non-negative integers Returns: `True` or `False`

### Satisfies(cls, counter_values, update_instructions) Class Method | source code
Return `True` iff the counter values satisfy the update instructions. Parameters: `counter_values` - A map from CounterCondition to integer counter values `update_instructions` - A set of UpdateInstruction instances Returns: `True` iff all instructions are satisfied by the values and limits.

### apply(self, counter_values) | source code
Apply the update instruction to the provided counter values. Parameters: `counter_values` - A map from CounterCondition to integer counter values. This map is updated in-place.

### Apply(cls, update_instructions, counter_values) Class Method | source code
Apply the update instructions to the counter values. Parameters: `update_instructions` - A set of UpdateInstruction instances. `counter_values` - A map from CounterCondition instances to non-negative integers. This map is updated in-place by applying each instruction in `update_instructions`.

Property Details | [hide private]

### counterCondition A reference to the CounterCondition identifying the counter to be updated. The counter condition instance is used as a key to the dictionary maintaining current counter values. Get Method: __get_counterCondition(self) - A reference to the CounterCondition identifying the counter to be updated.

### doIncrement `True` if the counter is to be incremented; `False` if it is to be reset. Get Method: __get_doIncrement(self) - `True` if the counter is to be incremented; `False` if it is to be reset.