org.eclipse.emf.henshin.interpreter
Interface Match

All Superinterfaces:
Assignment
All Known Implementing Classes:
MatchImpl

public interface Match
extends Assignment

Interface for rules matches. Maps Nodes to EObjects and assigns parameter values by extending Assignment.


Method Summary
 List<Match> getMultiMatches(Rule multiRule)
          Get the nested matches for a multi-rule.
 EObject getNodeTarget(Node node)
          Get the match target for a node.
 List<EObject> getNodeTargets()
          Get all node targets of this match.
 Rule getRule()
          Get the rule that this match is used for.
 boolean isComplete()
          Checks if all nodes have a target and all nested matches are also complete.
 boolean isValid()
          Checks whether this match is complete, whether the typing of the matched objects is correct with respect to the node types, and whether all edges are present.
 boolean overlapsWith(Match match)
          Checks whether this match overlaps with another match.
 void setNodeTarget(Node node, EObject target)
          Set the match target for a node.
 
Methods inherited from interface org.eclipse.emf.henshin.interpreter.Assignment
clear, getParameterValue, getParameterValues, getUnit, isEmpty, isResult, setParameterValue
 

Method Detail

getRule

Rule getRule()
Get the rule that this match is used for.

Returns:
The rule.

getNodeTarget

EObject getNodeTarget(Node node)
Get the match target for a node.

Parameters:
node - The node.
Returns:
The matched target object.

setNodeTarget

void setNodeTarget(Node node,
                   EObject target)
Set the match target for a node.

Parameters:
node - The node.
target - The match target.

getNodeTargets

List<EObject> getNodeTargets()
Get all node targets of this match.

Returns:
All node targets.

getMultiMatches

List<Match> getMultiMatches(Rule multiRule)
Get the nested matches for a multi-rule.

Parameters:
multiRule - The multi-rule.
Returns:
List of matches.

overlapsWith

boolean overlapsWith(Match match)
Checks whether this match overlaps with another match. The second match can be from a different rule. Two matches overlap if getNodeTargets() contain shared elements.

Parameters:
match - A second match to check against.
Returns:
true if both matches have common targets.

isComplete

boolean isComplete()
Checks if all nodes have a target and all nested matches are also complete.

Returns:
true if all nodes are matched.

isValid

boolean isValid()
Checks whether this match is complete, whether the typing of the matched objects is correct with respect to the node types, and whether all edges are present.

Returns:
true if the match is valid.