|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.henshin.interpreter.impl.EngineImpl
public class EngineImpl
Default Engine
implementation.
Field Summary | |
---|---|
protected Map<Graph,org.eclipse.emf.henshin.interpreter.impl.EngineImpl.MatchingOptions> |
graphOptions
Cached graph options. |
protected boolean |
inverseMatchingOrder
Whether to use inverse matching order. |
protected Map<String,Object> |
options
Options to be used. |
protected Map<Rule,org.eclipse.emf.henshin.interpreter.info.RuleInfo> |
ruleInfos
Cached information lookup map for each rule. |
protected EContentAdapter |
ruleListener
Listen for rule changes. |
protected ScriptEngineWrapper |
scriptEngine
Script engine used to compute Java expressions in attributes. |
protected boolean |
sortVariables
Whether to sort variables. |
protected ExecutorService |
workerPool
Worker thread pool. |
Fields inherited from interface org.eclipse.emf.henshin.interpreter.Engine |
---|
OPTION_CHECK_DANGLING, OPTION_DETERMINISTIC, OPTION_INJECTIVE_MATCHING, OPTION_INVERSE_MATCHING_ORDER, OPTION_SORT_VARIABLES, OPTION_WORKER_THREADS |
Constructor Summary | |
---|---|
EngineImpl()
Default constructor. |
Method Summary | |
---|---|
void |
clearCache()
Clear the cache of this engine. |
Change |
createChange(Rule rule,
EGraph graph,
Match completeMatch,
Match resultMatch)
Create an Change for applying a rule. |
void |
createChanges(Rule rule,
EGraph graph,
Match completeMatch,
Match resultMatch,
Change.CompoundChange complexChange)
Recursively create the changes and result matches. |
org.eclipse.emf.henshin.interpreter.matching.constraints.UnaryConstraint |
createUserConstraints(Attribute attribute)
Create user constraints for an attribute. |
org.eclipse.emf.henshin.interpreter.matching.constraints.BinaryConstraint |
createUserConstraints(Edge edge)
Create user constraints for an edge. |
org.eclipse.emf.henshin.interpreter.matching.constraints.UnaryConstraint |
createUserConstraints(Node node)
Create user constraints for a node. |
Object |
evalAttributeExpression(Attribute attribute,
Rule rule)
Evaluates a given attribute expression using the JavaScript engine. |
Iterable<Match> |
findMatches(Rule rule,
EGraph graph,
Match partialMatch)
Find matches for a Rule in an EGraph . |
protected org.eclipse.emf.henshin.interpreter.impl.EngineImpl.MatchingOptions |
getGraphOptions(Graph graph)
Get the options for a specific rule graph. |
Map<String,Object> |
getOptions()
Get or set the options for this engine. |
protected org.eclipse.emf.henshin.interpreter.info.RuleInfo |
getRuleInfo(Rule rule)
Get the cached rule info for a given rule. |
ScriptEngine |
getScriptEngine()
Get the used script engine. |
void |
shutdown()
Shutdown this engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Map<String,Object> options
protected final ScriptEngineWrapper scriptEngine
protected final Map<Rule,org.eclipse.emf.henshin.interpreter.info.RuleInfo> ruleInfos
protected final Map<Graph,org.eclipse.emf.henshin.interpreter.impl.EngineImpl.MatchingOptions> graphOptions
protected final EContentAdapter ruleListener
protected boolean sortVariables
protected boolean inverseMatchingOrder
protected ExecutorService workerPool
Constructor Detail |
---|
public EngineImpl()
Method Detail |
---|
public Iterable<Match> findMatches(Rule rule, EGraph graph, Match partialMatch)
Engine
Rule
in an EGraph
.
findMatches
in interface Engine
rule
- Rule to be matched.graph
- Graph where the match should be found.partialMatch
- Partial match (can be empty or null
).
protected org.eclipse.emf.henshin.interpreter.info.RuleInfo getRuleInfo(Rule rule)
rule
- Rule.
public void clearCache()
public Change createChange(Rule rule, EGraph graph, Match completeMatch, Match resultMatch)
Engine
Change
for applying a rule.
createChange
in interface Engine
rule
- Rule to be applied.graph
- Graph where the rule should be applied.completeMatch
- A complete match for the rule in the graph.resultMatch
- This result match will be initialized by the engine!
Change
object that can be used to apply the rulepublic void createChanges(Rule rule, EGraph graph, Match completeMatch, Match resultMatch, Change.CompoundChange complexChange)
rule
- Rule to be applied.graph
- Host graph.completeMatch
- The complete match.resultMatch
- The result match.complexChange
- The final complex change.public Object evalAttributeExpression(Attribute attribute, Rule rule)
attribute
- Attribute to be interpreted.
public Map<String,Object> getOptions()
Engine
getOptions
in interface Engine
protected org.eclipse.emf.henshin.interpreter.impl.EngineImpl.MatchingOptions getGraphOptions(Graph graph)
graph
- The graph.
public ScriptEngine getScriptEngine()
Engine
getScriptEngine
in interface Engine
public void shutdown()
Engine
shutdown
in interface Engine
public org.eclipse.emf.henshin.interpreter.matching.constraints.UnaryConstraint createUserConstraints(Node node)
node
- A node.
public org.eclipse.emf.henshin.interpreter.matching.constraints.BinaryConstraint createUserConstraints(Edge edge)
edge
- An edge.
public org.eclipse.emf.henshin.interpreter.matching.constraints.UnaryConstraint createUserConstraints(Attribute attribute)
attribute
- An attribute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |