Class LoopInvariant
java.lang.Object
org.apache.groovy.contracts.domain.Assertion<LoopInvariant>
org.apache.groovy.contracts.domain.LoopInvariant
A loop-invariant assertion that must hold at the start of each iteration.
- Since:
- 6.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LoopInvariantShared invariant instance representing an unconstrained loop invariant. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a loop invariant that defaults totrue.LoopInvariant(BlockStatement blockStatement, BooleanExpression booleanExpression) Creates a loop invariant from the supplied source block and boolean expression. -
Method Summary
Methods inherited from class org.apache.groovy.contracts.domain.Assertion
and, booleanExpression, or, originalBlockStatement, renew
-
Field Details
-
DEFAULT
Shared invariant instance representing an unconstrained loop invariant.
-
-
Constructor Details
-
LoopInvariant
public LoopInvariant()Creates a loop invariant that defaults totrue. -
LoopInvariant
Creates a loop invariant from the supplied source block and boolean expression.- Parameters:
blockStatement- the original invariant blockbooleanExpression- the normalized invariant expression
-