agg.parser
Class ExcludePairHelper

java.lang.Object
  extended by agg.parser.ExcludePairHelper

public final class ExcludePairHelper
extends java.lang.Object


Constructor Summary
ExcludePairHelper()
           
 
Method Summary
protected  void doReplaceConstantByInputParam(VarTuple vars, java.util.Enumeration<?> en, OrdinaryMorphism nac, java.util.Hashtable<ValueMember,java.lang.String> var2const)
           
protected static java.util.Vector<ValueMember> findMemberWhichUsesVariable(java.lang.String variablenName, GraphObject obj)
          Searches in a graph object for a given variable name of the attributes.
protected static java.util.Vector<ValueMember> getChangedAttributeMember(Rule r, GraphObject leftObj)
          Returns a set of all changed attribute members for a given graph object from the left-hand side of a rule.
protected static java.util.Vector<Type> getForbiddenTypesRule2(Rule rule2, java.util.Hashtable<ValueMember,Pair<java.lang.String,java.lang.String>> attrMember2Constant)
           
protected static Type getTypeWhenDifferentAttrValue(OrdinaryMorphism morph, GraphObject imageObj, java.util.Hashtable<ValueMember,Pair<java.lang.String,java.lang.String>> attrMember2Constant)
          Returns the Type of the GraphObject imageObj if 1) it has not any inverse image of Morphism morph, or 2) it has an inverse image and an attr. member of it is in the Hashtable attrMember2Constant.
protected static boolean graphSatisfiesTypeMaxMultiplicity(OrdinaryMorphism morph)
           
protected static boolean hasConstantValueOfAttribute(OrdinaryMorphism morph)
           
protected static boolean hasVariableInContext(OrdinaryMorphism morph)
           
protected static boolean isAttributeRestricted(Rule r, GraphObject obj)
          Returns true if the GraphObject obj has an attribute member with constant value or a variable which is used as an input parameter.
protected static boolean isAttrMemberChangedFromLeftToRight(Rule rule1, Rule rule2, ValueMember changedLeftMemberOfRule1, GraphObject lhsRule1Object, GraphObject lhsRule2Object, OrdinaryMorphism nacInsideOverlapGraph, GraphObject overlapObject)
           
protected static boolean isAttrMemberChangedFromNACRule2ToRight(Rule rule1, Rule rule2, Pair<OrdinaryMorphism,OrdinaryMorphism> overlapping, OrdinaryMorphism nacInsideOverlapGraph, java.util.List<GraphObject> changedAttributesR1, java.util.List<Type> forbiddenTypesR2, java.util.Hashtable<ValueMember,Pair<java.lang.String,java.lang.String>> attrMember2Constant)
           
protected static boolean isAttrMemberChangedFromPACRule2ToRight(Rule rule1, Rule rule2, GraphObject l1Object, GraphObject overlapObject, Pair<OrdinaryMorphism,OrdinaryMorphism> helpPair)
           
static void renameContextVariableOfOverlapping(Rule r1, Rule r2, Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>> pair, java.lang.String prefix1, java.lang.String prefix2)
           
protected  java.util.Hashtable<ValueMember,java.lang.String> replaceConstantByInputParam(Rule r, java.util.Hashtable<ValueMember,java.lang.String> var2const)
           
protected  void replaceInputParamByConstant(Rule r, java.util.Hashtable<ValueMember,java.lang.String> var2const)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcludePairHelper

public ExcludePairHelper()
Method Detail

graphSatisfiesTypeMaxMultiplicity

protected static boolean graphSatisfiesTypeMaxMultiplicity(OrdinaryMorphism morph)

isAttrMemberChangedFromLeftToRight

protected static boolean isAttrMemberChangedFromLeftToRight(Rule rule1,
                                                            Rule rule2,
                                                            ValueMember changedLeftMemberOfRule1,
                                                            GraphObject lhsRule1Object,
                                                            GraphObject lhsRule2Object,
                                                            OrdinaryMorphism nacInsideOverlapGraph,
                                                            GraphObject overlapObject)

isAttrMemberChangedFromPACRule2ToRight

protected static boolean isAttrMemberChangedFromPACRule2ToRight(Rule rule1,
                                                                Rule rule2,
                                                                GraphObject l1Object,
                                                                GraphObject overlapObject,
                                                                Pair<OrdinaryMorphism,OrdinaryMorphism> helpPair)

isAttrMemberChangedFromNACRule2ToRight

protected static boolean isAttrMemberChangedFromNACRule2ToRight(Rule rule1,
                                                                Rule rule2,
                                                                Pair<OrdinaryMorphism,OrdinaryMorphism> overlapping,
                                                                OrdinaryMorphism nacInsideOverlapGraph,
                                                                java.util.List<GraphObject> changedAttributesR1,
                                                                java.util.List<Type> forbiddenTypesR2,
                                                                java.util.Hashtable<ValueMember,Pair<java.lang.String,java.lang.String>> attrMember2Constant)

renameContextVariableOfOverlapping

public static void renameContextVariableOfOverlapping(Rule r1,
                                                      Rule r2,
                                                      Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>> pair,
                                                      java.lang.String prefix1,
                                                      java.lang.String prefix2)

findMemberWhichUsesVariable

protected static java.util.Vector<ValueMember> findMemberWhichUsesVariable(java.lang.String variablenName,
                                                                           GraphObject obj)
Searches in a graph object for a given variable name of the attributes.

Parameters:
name - The name of the variable
grob - The graph object to search in.
Returns:
A set of all attribute members which contain the variable with the given name.

getForbiddenTypesRule2

protected static java.util.Vector<Type> getForbiddenTypesRule2(Rule rule2,
                                                               java.util.Hashtable<ValueMember,Pair<java.lang.String,java.lang.String>> attrMember2Constant)

getTypeWhenDifferentAttrValue

protected static Type getTypeWhenDifferentAttrValue(OrdinaryMorphism morph,
                                                    GraphObject imageObj,
                                                    java.util.Hashtable<ValueMember,Pair<java.lang.String,java.lang.String>> attrMember2Constant)
Returns the Type of the GraphObject imageObj if 1) it has not any inverse image of Morphism morph, or 2) it has an inverse image and an attr. member of it is in the Hashtable attrMember2Constant. The Hashtable attrMember2Constant contains Pairs where the first string is the name of a variable, the second string is a constant value of the variable. Otherwise, returns null.

Parameters:
morph - OrdinaryMorphism to search
imageObj - GraphObject to check
attrMember2Constant - it contains Pairs where the first string is the name of a variable, the second string is a constant value of the variable. A key is a ValuMember.
Returns:
Type the Type of the imageObj

getChangedAttributeMember

protected static java.util.Vector<ValueMember> getChangedAttributeMember(Rule r,
                                                                         GraphObject leftObj)
Returns a set of all changed attribute members for a given graph object from the left-hand side of a rule. An attribute member changed when the right attribute member is set and the left attribute member is not set, or set to variable with an different name or constant, or complex expression.

Parameters:
r - The rule.
goLeft - A graph object of the rule which may contain attributes which will be changed.
Returns:
if the vector is null no member has changed

isAttributeRestricted

protected static boolean isAttributeRestricted(Rule r,
                                               GraphObject obj)
Returns true if the GraphObject obj has an attribute member with constant value or a variable which is used as an input parameter. Otherwise, returns false.

Parameters:
r -
obj -
Returns:

hasVariableInContext

protected static boolean hasVariableInContext(OrdinaryMorphism morph)

hasConstantValueOfAttribute

protected static boolean hasConstantValueOfAttribute(OrdinaryMorphism morph)

replaceConstantByInputParam

protected java.util.Hashtable<ValueMember,java.lang.String> replaceConstantByInputParam(Rule r,
                                                                                        java.util.Hashtable<ValueMember,java.lang.String> var2const)

doReplaceConstantByInputParam

protected void doReplaceConstantByInputParam(VarTuple vars,
                                             java.util.Enumeration<?> en,
                                             OrdinaryMorphism nac,
                                             java.util.Hashtable<ValueMember,java.lang.String> var2const)

replaceInputParamByConstant

protected void replaceInputParamByConstant(Rule r,
                                           java.util.Hashtable<ValueMember,java.lang.String> var2const)