Package org.eclipse.m2m.atl.emftvm.impl
Class RuleImpl.UniqueState
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.impl.RuleImpl.UniqueState
-
- Direct Known Subclasses:
RuleImpl.UniqueOffState,RuleImpl.UniqueOnState
- Enclosing class:
- RuleImpl
protected abstract class RuleImpl.UniqueState extends java.lang.ObjectBase class for code that depends on the state ofRule.isUnique().
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUniqueState()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectapplyOne(StackFrame frame, TraceLink trace)Applies#getRule()totraceabstract voidcheckAndCreateUniqueMapping(TracedRule tr, org.eclipse.emf.common.util.EList<SourceElement> ses)Checks for existence and creates a unique trace mapping entry for the source values inses, if applicable.abstract voidcreateUniqueMapping(TraceLink trace)Creates a unique trace mapping entry for the source values intrace, if applicable.TraceLinkgetUniqueTrace(StackFrame frame, java.lang.Object[] values)Returns the unique rule application trace forvalues, if applicable.abstract booleanmatchFor(StackFrame frame, java.lang.Object[] values)Matches this rule againstvalues, and records a match inExecEnv.getMatches()in case of a match.abstract booleanmatchFor(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap, java.lang.Object[] values)Matches this rule againstvalues, and records a match inExecEnv.getMatches()in case of a match.
-
-
-
Method Detail
-
createUniqueMapping
public abstract void createUniqueMapping(TraceLink trace)
Creates a unique trace mapping entry for the source values intrace, if applicable.- Parameters:
trace- the trace element with source values
-
checkAndCreateUniqueMapping
public abstract void checkAndCreateUniqueMapping(TracedRule tr, org.eclipse.emf.common.util.EList<SourceElement> ses)
Checks for existence and creates a unique trace mapping entry for the source values inses, if applicable.- Parameters:
tr- the traced rule to add the unique traces toses- the source values that serve as a the unique trace key
-
matchFor
public abstract boolean matchFor(StackFrame frame, java.lang.Object[] values)
Matches this rule againstvalues, and records a match inExecEnv.getMatches()in case of a match. In case of a unique rule, this method will not match if the rule has already matched againstvaluesbefore.- Parameters:
frame- the stack frame contextvalues- the source values to match against- Returns:
trueiff this rule matches againstvalues
-
matchFor
public abstract boolean matchFor(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap, java.lang.Object[] values)
Matches this rule againstvalues, and records a match inExecEnv.getMatches()in case of a match. In case of a unique rule, this method will not match if the rule has already matched againstvaluesbefore.- Parameters:
frame- the stack frame contextvaluesMap- the map of all values, including super-rule elementsvalues- the source values to match against- Returns:
trueiff this rule matches againstvalues
-
getUniqueTrace
public TraceLink getUniqueTrace(StackFrame frame, java.lang.Object[] values)
Returns the unique rule application trace forvalues, if applicable.- Parameters:
frame- the stack frame contextvalues- the source values for the trace- Returns:
- the unique rule application trace, or
null
-
applyOne
public java.lang.Object applyOne(StackFrame frame, TraceLink trace)
Applies#getRule()totrace- Parameters:
frame- the stack frame in which to execute the applier and post-applytrace- the trace link with values to which to apply the rule- Returns:
- the rule application result
-
-