| ↑ Table of Contents ↑ | §5.4.1.(b) Method guards >> |
§5.4.1.(a) Method binding guards
A guard may be attached to a callin method binding as in:
void roleMethod(int ir) <- after void baseMethod(int ib) when (ir > MyTeam.this.threshold);
Such a guard only affects the callin binding to which it is attached,
i.e., this specific callin binding is only effective,
if the predicate evaluates to true.
The following values are within the scope of the predicate expression,
and thus can be used to express the condition:
- The role instance denoted by
this.
Features of the role instance can also be accessed relative tothiswith or without explicit qualifyingthis. - The team instance denoted by a qualified this reference as in
MyTeam.this. - If the callin binding includes signatures (as in the example above):
Parameters of the role method.
If parameter mappings are involved, they will be evaluated before evaluating the guard.
| ↑ Table of Contents ↑ | §5.4.1.(b) Method guards >> |