Class Applicator
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop.Applicator
-
- Direct Known Subclasses:
BuildCollectionApplicator,BuildEnablingApplicator,BuildExecutionApplicator
public abstract class Applicator extends java.lang.ObjectApplies the result of the matches determined by theLhsRhsMatchLoop.matchLoop(Rule, Object[], Applicator, ITracer)method.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description Applicator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidapply(java.lang.Object expectedLhsValue, java.lang.Object rhsValue, int index)Apply this applicator for one combination which requires building.protected voidconditionLoopFinished()Notifies when the condition loop terminated.intgetElementCount()Returns the value of the elements handles by this applicator, i.e., the maximum index + 1.protected voidinitialize(Rule rule, java.lang.Object[] rhsValues)Initializes the applicator for the underlying loop.protected voidmatchLoopFinished()Notifies when the match loop terminated.protected booleanstopConditionLoop()Enables a pre-exit of the condition loop.protected booleanstopMatchLoop()Enables a pre-exit of the match loop.
-
-
-
Field Detail
-
rule
protected Rule rule
-
rhsValues
protected java.lang.Object[] rhsValues
-
-
Method Detail
-
initialize
protected void initialize(Rule rule, java.lang.Object[] rhsValues)
Initializes the applicator for the underlying loop. This method has been defined here in order to ensure consistency between applicator and underlying loop.- Parameters:
rule- the rule to work onrhsValues- the RHS value
-
apply
public abstract void apply(java.lang.Object expectedLhsValue, java.lang.Object rhsValue, int index) throws VilExceptionApply 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)
- 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 (getElementCount()- Throws:
java.lang.IndexOutOfBoundsException- ifindexis invalidVilException- in case that executing parts of a rule or setting variable values fails
- is newer than
-
getElementCount
public int getElementCount()
Returns the value of the elements handles by this applicator, i.e., the maximum index + 1.- Returns:
- the element count
-
stopMatchLoop
protected boolean stopMatchLoop()
Enables a pre-exit of the match loop.- Returns:
trueif the match loop shall exit before the next iteration,falseif the loop shall continue (default)
-
stopConditionLoop
protected boolean stopConditionLoop()
Enables a pre-exit of the condition loop.- Returns:
trueif the condition loop shall exit before the next iteration,falseif the loop shall continue (default)
-
matchLoopFinished
protected void matchLoopFinished() throws VilExceptionNotifies when the match loop terminated.- Throws:
VilException- in case that executing parts of a rule fails
-
conditionLoopFinished
protected void conditionLoopFinished() throws VilExceptionNotifies when the condition loop terminated.- Throws:
VilException- in case that executing parts of a rule fails
-
-