|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
agg.util.ExtObservable
agg.xt_basis.OrdinaryMorphism
agg.xt_basis.Rule
public class Rule
At the moment, AGG implements the DPO approach by switching on the * dangling-edge-condition by default. However, the DEC can be switched * off manually such that AGG operates on the SPO. (SG, Aug.1999)
Field Summary | |
---|---|
protected boolean |
applicable
|
protected java.util.Vector<EvalSet> |
atom_conditions
|
protected java.util.Hashtable<GraphObject,GraphObject> |
changedPreserved
|
protected java.util.Vector<java.lang.String> |
constraintNamesSet
|
protected java.util.Vector<Formula> |
constraints
|
protected java.util.Vector<GraphObject> |
created
|
protected java.util.Vector<GraphObject> |
deleted
|
protected java.util.Vector<GraphObject> |
forbiden
|
protected boolean |
generatePostConstraints
|
protected boolean |
isChanging
|
protected boolean |
isCreating
|
protected boolean |
isDeleting
|
protected boolean |
isReady
|
protected java.util.Vector<OrdinaryMorphism> |
itsNACs
|
protected java.util.Vector<OrdinaryMorphism> |
itsPACs
|
protected java.util.Vector<AtomConstraint> |
itsUsedAtomics
|
protected java.util.Vector<Formula> |
itsUsedFormulas
|
protected int |
layer
|
protected boolean |
parallelMatching
|
protected java.util.Vector<GraphObject> |
preserved
|
protected int |
priority
|
protected boolean |
triggerOfLayer
|
protected java.util.List<java.lang.String> |
typesWhichNeedMultiplicityCheck
|
Fields inherited from class agg.xt_basis.OrdinaryMorphism |
---|
cKeepContext, comment, enabled, errorMsg, errors, itsAttrContext, itsAttrManager, itsAttrMappings, itsCodomObjects, itsCoMorph, itsCompleter, itsDomObjects, itsImag, itsInteractiveFlag, itsName, itsOrig, itsTouchedFlag, partialMorphCompletion, removeAttrMapping, typeObjectsMapChanged |
Constructor Summary | |
---|---|
protected |
Rule()
Create myself. |
protected |
Rule(Graph left,
Graph right)
Create myself. |
protected |
Rule(TypeSet types)
Create myself. |
Method Summary | |
---|---|
void |
addConstraint(Formula f)
Adds the specified graph constraint to its list of constraints which can be converted to the post application constraints. |
boolean |
addNAC(OrdinaryMorphism nac)
Adds the specified morphism representing a negative application condition (NAC). |
boolean |
addPAC(OrdinaryMorphism pac)
Adds the specified morphism representing a positive application condition (PAC). |
void |
adjustAttrContextOfMatch(boolean inputParameterOnly)
Checks existing variables of the attribute context against the attribute context of its current match and adjusts the attribute context of its match, if needed. |
boolean |
areNACsValid()
always returns TRUE. |
boolean |
arePACsValid()
always returns TRUE! |
boolean |
canMatch(Graph g,
MorphCompletionStrategy strategy)
Returns true if this rule can make a match basically. |
java.lang.String |
checkInputParameterSet()
Returns the name of an input parameter whithout value, otherwise - null. |
java.util.Vector<java.lang.String> |
checkInputParameterSet(boolean left)
Returns name(s) of the variables of the attribute context which are used as input parameter(s) of this rule and they are not set. |
boolean |
checkMakeAbstract(Type nodeType)
Returns FALSE if the specified nodeType is an abstract type and used in the RHS to create a node, otherwise - TRUE. |
protected boolean |
checkType(Type orig,
Type image)
Checks the type compatibility of two graph objects. |
void |
clearConstraints()
Clears lists of its graph constraints. |
void |
clearConstraints(AtomConstraint ac)
Clears its lists of graph constraints only if the specified atomic graph constraint belongs to its constraints. |
void |
clearConstraints(Formula f)
Clears its lists of graph constraints only if the specified graph constraint belongs to its constraints. |
void |
clearRule()
|
boolean |
compareConstantAttributeValue(GraphObject src,
GraphObject tgt)
Compares attribute value of the specified objects due to constant value of the first object. |
boolean |
compareConstantAttributeValueOfMappedObjects(GraphObject src,
GraphObject tgt)
Compares attribute value of the specified objects due to constant value of the first object. |
boolean |
compareTo(Rule r)
Compares its LHS, RHS, morphism, NACs, PACs and attribute context to the appropriate elements of the specified rule. |
java.lang.String |
convertUsedFormulas()
Generates rule post application conditions from its constraints(formulas). |
OrdinaryMorphism |
createNAC()
Creates a new negative application condition (NAC) and add it to its NACs. |
OrdinaryMorphism |
createPAC()
Creates a new positive application condition (PAC) and add it to its PACs. |
void |
destroyNAC(OrdinaryMorphism nac)
Destroys the specified NAC from my NACs. |
boolean |
destroyObjectsOfType(Type t)
Try to destroy all graph objects of the specified type from its graphs (LHS, RHS, NACs, PACs, graph constraints). |
java.util.Vector<java.lang.String> |
destroyObjectsOfTypes(java.util.Vector<Type> types)
Try to destroy all graph objects of the specified types from its graphs (LHS, RHS, NACs, PACs, graph constraints). |
void |
destroyPAC(OrdinaryMorphism pac)
Destroys the specified pac from my set of PACs. |
void |
dispose()
Remove all graph object mappings and all relations to its source and target graphs. |
void |
enableInputParameter(boolean enable)
|
void |
enableNACs(boolean enable)
|
void |
enablePACs(boolean enable)
|
void |
finalize()
|
java.util.Vector<EvalSet> |
getAtomApplConds()
|
Rule |
getClone()
Returns a copy of this rule. |
java.util.Vector<java.lang.String> |
getConstraintNames()
|
java.util.Vector<Formula> |
getConstraints()
Returns its graph constraints which can be converted to the post application constraints. |
java.util.Hashtable<GraphObject,GraphObject> |
getElementsToChange()
Returns preserved elements which attributes should be changed. |
java.util.Vector<GraphObject> |
getElementsToCreate()
Returns elements of the RHS to create. |
java.util.Vector<GraphObject> |
getElementsToDelete()
Returns elements of the LHS to delete. |
java.util.Vector<GraphObject> |
getElementsToPreserve()
Returns elements of the LHS which should be preserved. |
java.lang.String |
getErrorMsg()
Returns error message if this rule is not ready to transform. |
java.util.Vector<VarMember> |
getInputParameters()
Returns variables of the attribute context of this rule which are used as input parameter for the rule application. |
java.util.Vector<VarMember> |
getInputParametersOfGraphObject(GraphObject go)
Returns variables of the attribute context of this rule which are used from attributes of the specified graph object as input parameter for the rule application. |
int |
getLayer()
Returns its layer. |
Graph |
getLeft()
Returns its left graph. |
Match |
getMatch()
Returns my current match |
OrdinaryMorphism |
getMorphism()
Return its morphism between the left and right graphs. |
OrdinaryMorphism |
getNAC(java.lang.String name)
Returns an OrdinaryMorphism representing a NAC with the specified name. |
java.util.Enumeration<OrdinaryMorphism> |
getNACs()
Returns an enumeration of my NACs. |
java.util.List<OrdinaryMorphism> |
getNACsList()
|
java.util.Vector<OrdinaryMorphism> |
getNACsVector()
Deprecated. replaced by getNACsList() |
int |
getNumberOfObjectsToCreate()
Deprecated. use getElementsToCreate().size() |
int |
getNumberOfObjectsToDelete()
Deprecated. use getElementsToDelete().size() |
java.util.Vector<GraphObject> |
getObjectsToCreate()
Deprecated. replaced by Vector |
java.util.Vector<GraphObject> |
getObjectsToDelete()
Deprecated. replaced by Vector |
OrdinaryMorphism |
getPAC(java.lang.String name)
Returns an OrdinaryMorphism representing a PAC with the specified name. |
java.util.Enumeration<OrdinaryMorphism> |
getPACs()
Return an enumeration of my PACs with elements of type OrdinaryMorphism . |
java.util.List<OrdinaryMorphism> |
getPACsList()
|
java.util.Vector<OrdinaryMorphism> |
getPACsVector()
Deprecated. replaced by getPACsList()
Return the Vector of my PACs with elements of type
OrdinaryMorphism . |
int |
getPriority()
Returns my priority. |
Graph |
getRight()
Returns its right graph. |
TypeSet |
getTypeSet()
|
java.util.List<java.lang.String> |
getTypesWhichNeedMultiplicityCheck()
|
java.util.Vector<AtomConstraint> |
getUsedAtomics()
Return a vector of atomic graph constraints used for generating post application conditions. |
java.util.Vector<Formula> |
getUsedFormulas()
Return the vector of constraints (formulas) used for generating post application conditions. |
java.util.Vector<Type> |
getUsedTypes()
|
boolean |
hasNACs()
Returns true if it contains a NAC. |
boolean |
hasPACs()
Returns true, if its contains a PAC. |
Pair<Rule,Pair<OrdinaryMorphism,OrdinaryMorphism>> |
invertComplex()
Tries to invert this rule. |
Rule |
invertSimplex()
Returns an inverted rule. |
boolean |
isApplicable()
Returns the value which set by setApplicable(boolean appl) . |
boolean |
isApplicable(Graph g,
MorphCompletionStrategy strategy)
Checks whether this rule is applicable at the specified graph by the specified matching strategy or not. |
boolean |
isApplicable(Graph g,
MorphCompletionStrategy strategy,
boolean doCheckIfReadyToTransform)
Checks whether this rule is applicable at the specified graph by the specified matching strategy or not. |
boolean |
isArcDeleting()
|
boolean |
isChanging()
Returns true if this rule will change some attributes of the graph elements, otherwise - false. |
boolean |
isCreating()
Returns true if this rule will create new graph elements, otherwise - false. |
boolean |
isDeleting()
Returns true if this rule will delete some graph elements, otherwise - false. |
boolean |
isElement(Graph g)
Checks if the specified graph is its LHS, RHS, target of a NAC, target of a PAC graph. |
boolean |
isEmptyRule()
Return true if its left and right graphs are empty and there aren't any NACs and PACs, otherwise - false. |
boolean |
isLeftApplicable(Graph g,
MorphCompletionStrategy strategy,
boolean doCheckIfReadyToTransform)
Checks whether this rule is applicable at the specified graph by the specified matching strategy or not. |
boolean |
isNACValid(OrdinaryMorphism nac)
always returns TRUE. |
boolean |
isNodeDeleting()
|
boolean |
isPACValid(OrdinaryMorphism pac)
always returns TRUE! |
boolean |
isParallelApplyEnabled()
|
boolean |
isReadyToTransform()
Checks attribute setting of RHS, variable declarations and attribute conditions. |
boolean |
isReadyToTransform(boolean prepareRuleInfo)
Deprecated. replaced by isReadyToTransform() that includs update of the rule infos |
boolean |
isTriggerOfLayer()
Checks if this rule is a trigger rule of its layer. |
boolean |
isUsingType(GraphObject typeObj)
Returns true if this rule, its NACs or PACs are using the specified type which is an element (node or edge) of a type graph. |
void |
prepareRuleInfo()
Prepares info about this rule: node, edges to preserve, change, delete, create; types which should be checked due to node resp. edge type multiplicity. |
void |
removeApplConditions()
Clears its application constraints. |
void |
removeAtomApplCond(AtomApplCond atom)
Removes the specified atomic application condition from its post application conditions. |
void |
removeConstraint(EvalSet constraint)
Removes the specified application condition from its post application conditions. |
boolean |
removeNAC(OrdinaryMorphism nac)
Removes a negative application condition. |
boolean |
removePAC(OrdinaryMorphism pac)
Removes the specified positive application condition. |
void |
removeUnusedVariableOfAttrContext()
|
void |
resetTargetOfMatch(Graph g)
Reset target graph of its match, if it exists. |
protected void |
restoreVariableDeclaration()
Restores variable declarations of the RHS, NACs and PACs. |
void |
setApplicable(boolean appl)
|
void |
setAtomApplConds(java.util.Vector<EvalSet> v,
java.util.Vector<java.lang.String> names)
Set the specified post application conditions to its conditions. |
void |
setInputParameters(java.util.HashMap<java.lang.String,java.util.Vector<java.lang.Object>> parameters)
Set value of the input parameter of its attribute context. |
void |
setLayer(int l)
Sets its layer. |
void |
setMatch(Match m)
Set its match to the specified parameter. |
void |
setParallelMatchingEnabled(boolean b)
|
void |
setPriority(int p)
Sets my priority. |
void |
setTriggerForLayer(boolean trigger)
Set this rule to be a trigger rule of its layer. |
void |
setUsedFormulas(java.util.List<Formula> formulasToUse)
Set its constraints (formulas) which will be used for generating its post application conditions. |
void |
unsetInputParameter(boolean inputParameterOnly)
Set the value of variables of its attribute context to null. |
void |
XreadObject(XMLHelper h)
Implements the interface of XMLObject |
void |
XwriteObject(XMLHelper h)
Implements the interface of XMLObject |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Vector<OrdinaryMorphism> itsNACs
protected final java.util.Vector<OrdinaryMorphism> itsPACs
protected final java.util.Vector<AtomConstraint> itsUsedAtomics
protected final java.util.Vector<Formula> itsUsedFormulas
protected transient java.util.Vector<java.lang.String> constraintNamesSet
protected transient java.util.Vector<Formula> constraints
protected transient java.util.Vector<EvalSet> atom_conditions
protected transient boolean generatePostConstraints
protected transient boolean applicable
protected boolean parallelMatching
protected int layer
protected int priority
protected boolean triggerOfLayer
protected transient boolean isReady
protected transient boolean isDeleting
protected transient boolean isCreating
protected transient boolean isChanging
protected transient java.util.Vector<GraphObject> preserved
protected transient java.util.Vector<GraphObject> created
protected transient java.util.Vector<GraphObject> deleted
protected transient java.util.Vector<GraphObject> forbiden
protected transient java.util.Hashtable<GraphObject,GraphObject> changedPreserved
protected transient java.util.List<java.lang.String> typesWhichNeedMultiplicityCheck
Constructor Detail |
---|
protected Rule()
protected Rule(TypeSet types)
protected Rule(Graph left, Graph right)
left
- my left graph.right
- my right graph.Method Detail |
---|
public void dispose()
OrdinaryMorphism
dispose
in interface Disposable
dispose
in class OrdinaryMorphism
Change_ObservableGone
public void finalize()
finalize
in class ExtObservable
public void clearRule()
public boolean isElement(Graph g)
public final Graph getLeft()
public final Graph getRight()
public boolean isApplicable()
setApplicable(boolean appl)
.
public boolean isApplicable(Graph g, MorphCompletionStrategy strategy)
isReadyToTransform()
should be done before
public boolean isApplicable(Graph g, MorphCompletionStrategy strategy, boolean doCheckIfReadyToTransform)
public void enableInputParameter(boolean enable)
public boolean isLeftApplicable(Graph g, MorphCompletionStrategy strategy, boolean doCheckIfReadyToTransform)
public void enableNACs(boolean enable)
public void enablePACs(boolean enable)
public void setApplicable(boolean appl)
public TypeSet getTypeSet()
public OrdinaryMorphism createNAC()
nac
with
nac.getOriginal() == this.getOriginal()
.public boolean addNAC(OrdinaryMorphism nac)
Pre: nac.getOriginal() == this.getOriginal()
.
public void destroyNAC(OrdinaryMorphism nac)
public boolean hasNACs()
public java.util.Enumeration<OrdinaryMorphism> getNACs()
public java.util.Vector<OrdinaryMorphism> getNACsVector()
getNACsList()
public java.util.List<OrdinaryMorphism> getNACsList()
public OrdinaryMorphism getNAC(java.lang.String name)
public final boolean removeNAC(OrdinaryMorphism nac)
false
if nac
is not found,
otherwise - true
.public OrdinaryMorphism createPAC()
pac
with
pac.getOriginal() == this.getOriginal()
.public boolean addPAC(OrdinaryMorphism pac)
pac.getOriginal() == this.getOriginal()
.
public void destroyPAC(OrdinaryMorphism pac)
public boolean hasPACs()
public java.util.Enumeration<OrdinaryMorphism> getPACs()
OrdinaryMorphism
.
public java.util.Vector<OrdinaryMorphism> getPACsVector()
getPACsList()
Return the Vector of my PACs with elements of type
OrdinaryMorphism
.
public java.util.List<OrdinaryMorphism> getPACsList()
public OrdinaryMorphism getPAC(java.lang.String name)
public final boolean removePAC(OrdinaryMorphism pac)
false
if pac
is not found,
otherwise - true
.public boolean checkMakeAbstract(Type nodeType)
public boolean destroyObjectsOfType(Type t)
public java.util.Vector<java.lang.String> destroyObjectsOfTypes(java.util.Vector<Type> types)
public Rule getClone()
public final OrdinaryMorphism getMorphism()
public java.util.Vector<Formula> getConstraints()
public void addConstraint(Formula f)
protected boolean checkType(Type orig, Type image)
checkType
in class OrdinaryMorphism
public java.lang.String convertUsedFormulas()
public void setUsedFormulas(java.util.List<Formula> formulasToUse)
public java.util.Vector<AtomConstraint> getUsedAtomics()
public java.util.Vector<Formula> getUsedFormulas()
public void clearConstraints(AtomConstraint ac)
public void clearConstraints(Formula f)
public void clearConstraints()
public void setAtomApplConds(java.util.Vector<EvalSet> v, java.util.Vector<java.lang.String> names)
public java.util.Vector<EvalSet> getAtomApplConds()
public java.util.Vector<java.lang.String> getConstraintNames()
public void removeConstraint(EvalSet constraint)
public void removeAtomApplCond(AtomApplCond atom)
public void removeApplConditions()
public void setTriggerForLayer(boolean trigger)
trigger
- public boolean isTriggerOfLayer()
public int getLayer()
public void setLayer(int l)
public int getPriority()
public void setPriority(int p)
public boolean isUsingType(GraphObject typeObj)
public void removeUnusedVariableOfAttrContext()
removeUnusedVariableOfAttrContext
in class OrdinaryMorphism
public void XwriteObject(XMLHelper h)
XwriteObject
in interface XMLObject
public void XreadObject(XMLHelper h)
XreadObject
in interface XMLObject
public Rule invertSimplex()
public Pair<Rule,Pair<OrdinaryMorphism,OrdinaryMorphism>> invertComplex()
public Match getMatch()
public boolean compareConstantAttributeValue(GraphObject src, GraphObject tgt)
src
- first object (an object of the LHS of a rule)tar
- second object (an object of a NAC, PAC of a rule)
public boolean compareConstantAttributeValueOfMappedObjects(GraphObject src, GraphObject tgt)
src
- first object (an object of the LHS of a rule)tar
- second object (an object of a NAC, PAC of a rule)
public boolean compareTo(Rule r)
public java.util.Vector<VarMember> getInputParameters()
public java.util.Vector<VarMember> getInputParametersOfGraphObject(GraphObject go)
public boolean areNACsValid()
public boolean isNACValid(OrdinaryMorphism nac)
public boolean arePACsValid()
public boolean isPACValid(OrdinaryMorphism pac)
public void adjustAttrContextOfMatch(boolean inputParameterOnly)
public void unsetInputParameter(boolean inputParameterOnly)
public java.lang.String checkInputParameterSet()
public java.util.Vector<java.lang.String> checkInputParameterSet(boolean left)
public boolean isReadyToTransform(boolean prepareRuleInfo)
prepareRuleInfo
is true
prepares infos (is deleting, creating, changing) about this rule.
public boolean isReadyToTransform()
public void prepareRuleInfo()
public boolean isEmptyRule()
public java.util.List<java.lang.String> getTypesWhichNeedMultiplicityCheck()
public boolean isCreating()
public java.util.Vector<GraphObject> getObjectsToCreate()
Vector getElementsToCreate()
public int getNumberOfObjectsToCreate()
getElementsToCreate().size()
public boolean isDeleting()
public boolean isNodeDeleting()
public boolean isArcDeleting()
public java.util.Vector<GraphObject> getObjectsToDelete()
Vector getElementsToDelete()
public int getNumberOfObjectsToDelete()
getElementsToDelete().size()
public java.util.Vector<GraphObject> getElementsToPreserve()
public java.util.Vector<GraphObject> getElementsToCreate()
getElementsToCreate
in class OrdinaryMorphism
public java.util.Vector<GraphObject> getElementsToDelete()
getElementsToDelete
in class OrdinaryMorphism
public java.util.Hashtable<GraphObject,GraphObject> getElementsToChange()
public boolean isChanging()
protected void restoreVariableDeclaration()
public java.util.Vector<Type> getUsedTypes()
getUsedTypes
in class OrdinaryMorphism
public java.lang.String getErrorMsg()
getErrorMsg
in class OrdinaryMorphism
isReadyToTransform().
public boolean canMatch(Graph g, MorphCompletionStrategy strategy)
canMatch
in class OrdinaryMorphism
public void setMatch(Match m)
public void resetTargetOfMatch(Graph g)
public void setParallelMatchingEnabled(boolean b)
public boolean isParallelApplyEnabled()
public void setInputParameters(java.util.HashMap<java.lang.String,java.util.Vector<java.lang.Object>> parameters)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |