Class LhsRhsMatchLoop
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop.LhsRhsMatchLoop
-
public class LhsRhsMatchLoop extends java.lang.ObjectA generic loop over LHS/RHS matches determining which combinations need a build. Upon such collections, anApplicatoris called to perform specific actions.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description LhsRhsMatchLoop()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleanbuildNeeded(java.lang.Object lhsValue, java.lang.Object rhsValue)Returns whether a build is needed to turnrhsValueintolhsValue.static voidmatchLoop(Rule rule, java.lang.Object[] rhsValues, Applicator applicator, ITracer tracer)Loops over the LHS/RHS matches and calls theapplicatorfor each match.
-
-
-
Method Detail
-
matchLoop
public static void matchLoop(Rule rule, java.lang.Object[] rhsValues, Applicator applicator, ITracer tracer) throws VilException
Loops over the LHS/RHS matches and calls theapplicatorfor each match.- Parameters:
rule- the rule to loop overrhsValues- the already determined values for the RHS matching conditions (in case that there are multiple, may be null or empty)applicator- the applicator instance to be called on each match requiring a buildtracer- the tracer instance (needed to reorder the match sequence if required)- Throws:
VilException- in case that determining the expected LHS value or applying theapplicatorfails
-
buildNeeded
private static boolean buildNeeded(java.lang.Object lhsValue, java.lang.Object rhsValue)Returns whether a build is needed to turnrhsValueintolhsValue. Actually, both values are determined as values from visitingAbstractRuleMatchExpressionsand, therefore, are objects (internallyartifacts).- Parameters:
lhsValue- the (expected) individual value to be produced by a rulerhsValue- the individual input determined by a matching precondition- Returns:
trueif a build is needed becauselhsValuedoes not exist or is outdated,falseif a build is not needed
-
-