Class BuildEnablingApplicator
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop.Applicator
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop.BuildEnablingApplicator
-
public class BuildEnablingApplicator extends Applicator
An applicator which may enable the execution of a loop body. This applicator collects whether all conditions have at least one LHS/RHS match requiring a build. To be efficient, this applicator stops the loops as soon as possible.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private booleanallConditionsEnabledprivate booleanlhsRhsBuildMatchFound-
Fields inherited from class net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop.Applicator
rhsValues, rule
-
-
Constructor Summary
Constructors Constructor Description BuildEnablingApplicator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallConditionsEnabled()Returns whether all matching conditions are enabled.voidapply(java.lang.Object expectedLhsValue, java.lang.Object rhsValue, int index)Apply this applicator for one combination which requires building.voidmatchLoopFinished()Notifies when the match loop terminated.booleanstopConditionLoop()Enables a pre-exit of the condition loop.booleanstopMatchLoop()Enables a pre-exit of the match loop.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop.Applicator
conditionLoopFinished, getElementCount, initialize
-
-
-
-
Method Detail
-
apply
public void apply(java.lang.Object expectedLhsValue, java.lang.Object rhsValue, int index) throws VilExceptionDescription copied from class:ApplicatorApply this applicator for one combination which requires building. This may be due to the fact thatrhsValue- is newer than
expectedLhsValue - exists but
expectedLhsValuedoes not exist - exists but no LHS is specified (
expectedLhsValueis null)
- Specified by:
applyin classApplicator- Parameters:
expectedLhsValue- the expected result after buildingrhsValue(may be null)rhsValue- the value determined for the right side as part of a matchindex- the 0-based index of the RHS match condition in the specifying rule (Applicator.getElementCount()- Throws:
VilException- in case that executing parts of a rule or setting variable values fails
- is newer than
-
stopMatchLoop
public boolean stopMatchLoop()
Description copied from class:ApplicatorEnables a pre-exit of the match loop.- Overrides:
stopMatchLoopin classApplicator- Returns:
trueif the match loop shall exit before the next iteration,falseif the loop shall continue (default)
-
stopConditionLoop
public boolean stopConditionLoop()
Description copied from class:ApplicatorEnables a pre-exit of the condition loop.- Overrides:
stopConditionLoopin classApplicator- Returns:
trueif the condition loop shall exit before the next iteration,falseif the loop shall continue (default)
-
matchLoopFinished
public void matchLoopFinished() throws VilExceptionDescription copied from class:ApplicatorNotifies when the match loop terminated.- Overrides:
matchLoopFinishedin classApplicator- Throws:
VilException- in case that executing parts of a rule fails
-
allConditionsEnabled
public boolean allConditionsEnabled()
Returns whether all matching conditions are enabled.- Returns:
trueif all conditions are enabled,falseelse
-
-