agg.parser
Class ExcludePairContainer

java.lang.Object
  extended by agg.parser.ExcludePairContainer
All Implemented Interfaces:
PairContainer, XMLObject, java.lang.Runnable
Direct Known Subclasses:
DependencyPairContainer, LayeredExcludePairContainer, PriorityExcludePairContainer

public class ExcludePairContainer
extends java.lang.Object
implements PairContainer, java.lang.Runnable

This Container contains only conflict free and exclude relations.


Nested Class Summary
 class ExcludePairContainer.Entry
           
 
Field Summary
protected  boolean asymmetrically
           
protected  boolean calculateParallel
          true, if each calculation should be done in an extra Thread.
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,ExcludePairContainer.Entry>> commonContainer
          Contains for each Pair one Entry.
protected  boolean complete
           
protected  java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> conflictFreeContainer
          This container stores the conflict free relations.
protected  int conflictKind
           
protected  boolean consistent
           
protected  boolean equalVariableNameOfAttrMapping
           
protected  java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> excludeContainer
          This container stores the conflict relations.
protected  java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> excludeContainerForTestGraph
           
protected  ExcludePair excludePair
           
protected  GraGra grammar
          The graph grammar
protected  boolean ignoreIdenticalRules
           
protected  boolean isAlive
          true if global generating process is running.
protected  boolean isComputed
          true if all the relations are computed.
protected  boolean isComputedLocal
          true if one pair relations are computed.
protected  boolean isEmpty
           
protected  java.util.Vector<ParserEventListener> listener
           
protected  boolean reduce
           
protected  boolean reduceSameMatch
           
protected  java.util.List<Rule> rules
           
protected  boolean stop
          true if global generating process will be stopped
protected  MorphCompletionStrategy strategy
           
protected  boolean strongAttrCheck
           
protected  Graph testGraph
           
protected  boolean useHostGraph
           
protected  boolean withNACs
           
protected  boolean withPACs
           
 
Constructor Summary
ExcludePairContainer(GraGra gragra)
          Creates a new container for critical pairs.
 
Method Summary
protected  ExcludePairContainer.Entry addEntry(Rule r1, Rule r2, boolean critical, java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> overlapping)
           
 void addPairEventListener(ParserEventListener l)
          Adds a PairEventListener.
protected  void addQuadruple(java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> container, Rule r1, Rule r2, boolean critic, java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> overlapping)
          Adds four important data to a container.
 void checkConsistency()
           
protected  boolean checkCritical(Rule r1, Rule r2, Graph testgraph)
           
 void clear()
          Clears the rule pair containers.
 void clearEntry(Rule r1, Rule r2)
           
protected  void computeCritical(Rule r1, Rule r2)
          Computes if the first rule exclude the second rule.
protected  boolean computeCritical(Rule r1, Rule r2, Graph g)
           
 void enableComplete(boolean enable)
           
 void enableConsistent(boolean enable)
           
 void enableEqualVariableNameOfAttrMapping(boolean enable)
           
 void enableIgnoreIdenticalRules(boolean b)
           
 void enableNACs(boolean enable)
          Deprecated. replaced by setMorphismCompletionStrategy(MorphCompletionStrategy strat)
 void enablePACs(boolean enable)
           
 void enableReduce(boolean enable)
           
 void enableReduceSameMatch(boolean enable)
           
 void enableStrongAttrCheck(boolean enable)
           
 void enableUseHostGraph(boolean enable, Graph g)
           
 void enableUseHostGraph(boolean enable, Graph g, MorphCompletionStrategy strat)
           
protected  void fillContainers()
          Fills all containers with the critical pairs.
protected  void fillContainers(java.util.List<Rule> ruleList, boolean asymmetrical)
           
protected  void fillContainers(Rule r1, Rule r2)
          Fills all containers with the critical pairs.
protected  void firePairEvent(ParserEvent event)
          Sends a event to all its listeners.
 ExcludePair getActiveExcludePair()
           
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getConflictContainer()
           
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getConflictFreeContainer()
           
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getContainer(int kind)
          This container is a Hashtable with a rule as key.
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getContainer(int kind, java.util.List<Rule> ruleList, boolean asymmetrical)
           
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getContainer(int kind, Rule r1, Rule r2)
           
 java.lang.Object getCritical(Rule r1, Rule r2, int kind)
          Deprecated. replaced by getCriticalPair(Rule r1, Rule r2, int kind)
 java.lang.Object getCritical(Rule r1, Rule r2, int kind, boolean local)
          Deprecated. replaced by getCriticalPair(Rule r1, Rule r2, int kind, boolean local)
 java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> getCriticalForGraph(Rule r1, Rule r2)
           
 java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> getCriticalForGraph(Rule r1, Rule r2, Graph g)
          Computes the critical part of two rules and checks it on the specified Graph g.
protected  java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalPair(Rule r1, Rule r2, java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> container)
          Returns the critical object of two rules.
 java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalPair(Rule r1, Rule r2, int kind)
          computes the critical part of two rules.
 java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalPair(Rule r1, Rule r2, int kind, boolean local)
           
 java.util.Vector<Pair<java.util.Hashtable<GraphObject,GraphObject>,java.util.Hashtable<GraphObject,GraphObject>>> getCriticalPairAtGraph(Rule r1, Rule r2)
           
 java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalSet(int kind, Rule rule)
          This method computes which rules are in a relation of a special kind.
 ExcludePairContainer.Entry getEntry(Rule r1, Rule r2)
           
 ExcludePairContainer.Entry getEntry(Rule r1, Rule r2, boolean alreadyExistent)
           
 java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getExcludeContainer()
           
 java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> getExcludeContainerForTestGraph()
           
 GraGra getGrammar()
          Returns the graph grammar of the critical pairs.
 int getKindOfConflict()
          Returns CriticalPair.CONFLICT or CriticalPair.DEPENDENCY constant.
 LayerFunction getLayer()
          Deprecated.  
 java.util.Vector<Pair<OrdinaryMorphism,OrdinaryMorphism>> getLHSoverlappings(Rule r1, Rule r2, java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> criticalPairs)
           
 MorphCompletionStrategy getMorphCompletionStrategy()
           
 int getNumberOfContainers()
          Returns the number of containers.
 java.util.List<Rule> getRules()
           
 int getState(Rule r1, Rule r2)
          return if this pair of rules is already computed.
 void initAllContainer()
          Initials all containers.
 boolean isAlive()
           
 boolean isComputed()
           
 boolean isEmpty()
           
protected  void moveEntryFromExcludeToConflictFreeContainer(Rule r1, Rule r2)
           
protected  Pair<OrdinaryMorphism,OrdinaryMorphism> readOldOverlappingMorphisms(XMLHelper h, Rule r1, Rule r2, java.lang.String firstName, Graph overlapGraph)
           
protected  Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>> readOverlappingMorphisms(XMLHelper h, Rule r1, Rule r2, Graph overlapGraph)
           
 boolean reduceCriticalPairs()
           
protected  void removeEntryFromExcludeContainer(Rule r1, Rule r2)
           
 void removePairEventListener(ParserEventListener l)
          Removes a PairEventListener
 void run()
          Starts the filling of all containers parallel.
protected  void scheduleForComputing(Rule r1, Rule r2)
           
 void setComputeAsymetrically(boolean b)
           
 void setEntryRelationVisible(Rule rule1, Rule rule2, boolean vis, boolean local)
           
 void setEntryRuleVisible(Rule rule1, Rule rule2, boolean vis, boolean local, boolean context)
           
 void setGrammar(GraGra gragra)
          Sets the graph grammar for the critical pairs.
 void setMorphCompletionStrategy(MorphCompletionStrategy strat)
           
 void setRules(java.util.List<Rule> ruleList)
           
 void setStop(boolean b)
           
 void stop()
          Stops the running.
 java.lang.String toString()
          Provides a human readable text of the critical pairs.
 boolean useHostGraphEnabled()
           
 boolean wasStopped()
           
protected  void writeOverlapMorphisms(XMLHelper h, Rule r1, Rule r2, Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>> overlapping)
           
 void XreadObject(XMLHelper h)
          Reads the contents of a xml file to restore this object.
 void XwriteObject(XMLHelper h)
          Writes the contents of this object to a file in a xml format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

excludeContainer

protected java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> excludeContainer
This container stores the conflict relations.


calculateParallel

protected boolean calculateParallel
true, if each calculation should be done in an extra Thread. This makes only sense on computer with a lot of CPUs (at least 2).


conflictFreeContainer

protected java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> conflictFreeContainer
This container stores the conflict free relations.


commonContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,ExcludePairContainer.Entry>> commonContainer
Contains for each Pair one Entry. The structur is a hashtable of hashtables of Entry. This structure is used now for the agg.gui.parser.CriticalPairPanel


conflictKind

protected int conflictKind

grammar

protected GraGra grammar
The graph grammar


rules

protected java.util.List<Rule> rules

asymmetrically

protected boolean asymmetrically

isComputed

protected boolean isComputed
true if all the relations are computed.


isComputedLocal

protected boolean isComputedLocal
true if one pair relations are computed.


listener

protected final java.util.Vector<ParserEventListener> listener

stop

protected boolean stop
true if global generating process will be stopped


isAlive

protected boolean isAlive
true if global generating process is running.


excludePair

protected ExcludePair excludePair

complete

protected boolean complete

reduce

protected boolean reduce

reduceSameMatch

protected boolean reduceSameMatch

withNACs

protected boolean withNACs

withPACs

protected boolean withPACs

consistent

protected boolean consistent

strongAttrCheck

protected boolean strongAttrCheck

equalVariableNameOfAttrMapping

protected boolean equalVariableNameOfAttrMapping

useHostGraph

protected boolean useHostGraph

excludeContainerForTestGraph

protected final java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> excludeContainerForTestGraph

testGraph

protected Graph testGraph

strategy

protected MorphCompletionStrategy strategy

isEmpty

protected boolean isEmpty

ignoreIdenticalRules

protected boolean ignoreIdenticalRules
Constructor Detail

ExcludePairContainer

public ExcludePairContainer(GraGra gragra)
Creates a new container for critical pairs.

Parameters:
gragra - The graph grammar.
Method Detail

getActiveExcludePair

public ExcludePair getActiveExcludePair()
Specified by:
getActiveExcludePair in interface PairContainer

run

public void run()
Starts the filling of all containers parallel.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()
Stops the running.

Specified by:
stop in interface PairContainer

setStop

public void setStop(boolean b)
Specified by:
setStop in interface PairContainer

wasStopped

public boolean wasStopped()
Specified by:
wasStopped in interface PairContainer

enableIgnoreIdenticalRules

public void enableIgnoreIdenticalRules(boolean b)

getCriticalPair

public java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalPair(Rule r1,
                                                                                                                               Rule r2,
                                                                                                                               int kind)
                                                                                                                        throws InvalidAlgorithmException
computes the critical part of two rules. This can be a Vector of overlaping graphs.

Specified by:
getCriticalPair in interface PairContainer
Parameters:
r1 - The first part of a critical pair
r2 - The second part of a critical pair
kind - The kind of critical pair
Returns:
The critical object.
Throws:
InvalidAlgorithmException - Thrown if a illegal algorithm is chosen.

getCritical

public java.lang.Object getCritical(Rule r1,
                                    Rule r2,
                                    int kind)
                             throws InvalidAlgorithmException
Deprecated. replaced by getCriticalPair(Rule r1, Rule r2, int kind)

Specified by:
getCritical in interface PairContainer
Throws:
InvalidAlgorithmException

getCritical

public java.lang.Object getCritical(Rule r1,
                                    Rule r2,
                                    int kind,
                                    boolean local)
                             throws InvalidAlgorithmException
Deprecated. replaced by getCriticalPair(Rule r1, Rule r2, int kind, boolean local)

Throws:
InvalidAlgorithmException

getCriticalPair

public java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalPair(Rule r1,
                                                                                                                               Rule r2,
                                                                                                                               int kind,
                                                                                                                               boolean local)
                                                                                                                        throws InvalidAlgorithmException
Specified by:
getCriticalPair in interface PairContainer
Throws:
InvalidAlgorithmException

getCriticalForGraph

public java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> getCriticalForGraph(Rule r1,
                                                                                                                     Rule r2,
                                                                                                                     Graph g)
Computes the critical part of two rules and checks it on the specified Graph g. When an overlapping graph is not critical for the given Graph g it is removed from the critical part. Returns the critical object if it exists otherwise null. The specified rules are enabled and applicable to the Graph g, otherwise returns null.

Parameters:
r1 - The first part of a critical pair
r2 - The second part of a critical pair
g - The graph on which these two rules should be checked
Returns:
The critical object Hashtable>>, where a Graph is an overlapping graph and is a key, a Vector> contains found critical matches and is a value. Furthermore, a Hashtable defines a critical match of a key-Graph into the specified Graph g. Here a key-GraphObject belongs to a key-Graph which is an overlapping graph, a value-GraphObject belongs to the specified Graph g.

getCriticalPairAtGraph

public java.util.Vector<Pair<java.util.Hashtable<GraphObject,GraphObject>,java.util.Hashtable<GraphObject,GraphObject>>> getCriticalPairAtGraph(Rule r1,
                                                                                                                                                Rule r2)

getCriticalForGraph

public java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> getCriticalForGraph(Rule r1,
                                                                                                                     Rule r2)

getCriticalPair

protected java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalPair(Rule r1,
                                                                                                                                  Rule r2,
                                                                                                                                  java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> container)
Returns the critical object of two rules.

Parameters:
r1 - The first rule
r2 - The second rule
container - The container.
Returns:
The critical object is a Vector an element as a Pair.

getLHSoverlappings

public java.util.Vector<Pair<OrdinaryMorphism,OrdinaryMorphism>> getLHSoverlappings(Rule r1,
                                                                                    Rule r2,
                                                                                    java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> criticalPairs)

getNumberOfContainers

public int getNumberOfContainers()
Returns the number of containers.

Specified by:
getNumberOfContainers in interface PairContainer
Returns:
The number.

getExcludeContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getExcludeContainer()

getConflictContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getConflictContainer()

getConflictFreeContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getConflictFreeContainer()

getContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getContainer(int kind)
                                                                                                                                                                                                 throws InvalidAlgorithmException
This container is a Hashtable with a rule as key. The value will be a set of rules.

Specified by:
getContainer in interface PairContainer
Parameters:
kind - The desired algorithm
Returns:
The container.
Throws:
InvalidAlgorithmException - Thrown if a illegal algorithm is choosen

getContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getContainer(int kind,
                                                                                                                                                                                                        java.util.List<Rule> ruleList,
                                                                                                                                                                                                        boolean asymmetrical)
                                                                                                                                                                                                 throws InvalidAlgorithmException
Throws:
InvalidAlgorithmException

getContainer

public java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> getContainer(int kind,
                                                                                                                                                                                                        Rule r1,
                                                                                                                                                                                                        Rule r2)
                                                                                                                                                                                                 throws InvalidAlgorithmException
Throws:
InvalidAlgorithmException

getCriticalSet

public java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> getCriticalSet(int kind,
                                                                                                                              Rule rule)
                                                                                                                       throws InvalidAlgorithmException
This method computes which rules are in a relation of a special kind.

Specified by:
getCriticalSet in interface PairContainer
Parameters:
kind - The kind of critical pair
rule - The rule which is the first part of a critical pair
Returns:
The set of all the critic rules
Throws:
InvalidAlgorithmException - Thrown if a illegal algorithm is chosen

setGrammar

public void setGrammar(GraGra gragra)
Sets the graph grammar for the critical pairs.

Specified by:
setGrammar in interface PairContainer
Parameters:
gragra - The graph grammar

getGrammar

public GraGra getGrammar()
Returns the graph grammar of the critical pairs.

Specified by:
getGrammar in interface PairContainer
Returns:
The graph grammar.

setRules

public void setRules(java.util.List<Rule> ruleList)
Specified by:
setRules in interface PairContainer

getRules

public java.util.List<Rule> getRules()
Specified by:
getRules in interface PairContainer

setComputeAsymetrically

public void setComputeAsymetrically(boolean b)
Specified by:
setComputeAsymetrically in interface PairContainer

setMorphCompletionStrategy

public void setMorphCompletionStrategy(MorphCompletionStrategy strat)
Specified by:
setMorphCompletionStrategy in interface PairContainer

getMorphCompletionStrategy

public MorphCompletionStrategy getMorphCompletionStrategy()
Specified by:
getMorphCompletionStrategy in interface PairContainer

initAllContainer

public void initAllContainer()
Initials all containers. So there are at least empty objects to store the exclude relation.

Specified by:
initAllContainer in interface PairContainer

fillContainers

protected void fillContainers()
Fills all containers with the critical pairs.


fillContainers

protected void fillContainers(java.util.List<Rule> ruleList,
                              boolean asymmetrical)

scheduleForComputing

protected void scheduleForComputing(Rule r1,
                                    Rule r2)

fillContainers

protected void fillContainers(Rule r1,
                              Rule r2)
Fills all containers with the critical pairs.


computeCritical

protected void computeCritical(Rule r1,
                               Rule r2)
Computes if the first rule exclude the second rule. The result is added to the container.

Parameters:
r1 - The first rule.
r2 - The second rule.

computeCritical

protected boolean computeCritical(Rule r1,
                                  Rule r2,
                                  Graph g)

addQuadruple

protected void addQuadruple(java.util.Hashtable<Rule,java.util.Hashtable<Rule,Pair<java.lang.Boolean,java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>>>>> container,
                            Rule r1,
                            Rule r2,
                            boolean critic,
                            java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> overlapping)
Adds four important data to a container. This method is synchronized, because the underlaying container aren't protected and this method is called asynchronly by the method computeCritical.

Parameters:
container - The container the data are for
r1 - The first rule
r2 - The seconf rule
critic - true if the first rule excludes the second rule.
overlapping - The set of overlapping graphs of the first and second rule.

addEntry

protected ExcludePairContainer.Entry addEntry(Rule r1,
                                              Rule r2,
                                              boolean critical,
                                              java.util.Vector<Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>>> overlapping)

getEntry

public ExcludePairContainer.Entry getEntry(Rule r1,
                                           Rule r2)

getEntry

public ExcludePairContainer.Entry getEntry(Rule r1,
                                           Rule r2,
                                           boolean alreadyExistent)

clearEntry

public void clearEntry(Rule r1,
                       Rule r2)

setEntryRelationVisible

public void setEntryRelationVisible(Rule rule1,
                                    Rule rule2,
                                    boolean vis,
                                    boolean local)

setEntryRuleVisible

public void setEntryRuleVisible(Rule rule1,
                                Rule rule2,
                                boolean vis,
                                boolean local,
                                boolean context)

getState

public int getState(Rule r1,
                    Rule r2)
return if this pair of rules is already computed.


reduceCriticalPairs

public boolean reduceCriticalPairs()

checkConsistency

public void checkConsistency()

moveEntryFromExcludeToConflictFreeContainer

protected void moveEntryFromExcludeToConflictFreeContainer(Rule r1,
                                                           Rule r2)

removeEntryFromExcludeContainer

protected void removeEntryFromExcludeContainer(Rule r1,
                                               Rule r2)

checkCritical

protected boolean checkCritical(Rule r1,
                                Rule r2,
                                Graph testgraph)

getExcludeContainerForTestGraph

public java.util.Hashtable<Graph,java.util.Vector<java.util.Hashtable<GraphObject,GraphObject>>> getExcludeContainerForTestGraph()

clear

public void clear()
Clears the rule pair containers.

Specified by:
clear in interface PairContainer

writeOverlapMorphisms

protected void writeOverlapMorphisms(XMLHelper h,
                                     Rule r1,
                                     Rule r2,
                                     Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>> overlapping)

readOldOverlappingMorphisms

protected Pair<OrdinaryMorphism,OrdinaryMorphism> readOldOverlappingMorphisms(XMLHelper h,
                                                                              Rule r1,
                                                                              Rule r2,
                                                                              java.lang.String firstName,
                                                                              Graph overlapGraph)

readOverlappingMorphisms

protected Pair<Pair<OrdinaryMorphism,OrdinaryMorphism>,Pair<OrdinaryMorphism,OrdinaryMorphism>> readOverlappingMorphisms(XMLHelper h,
                                                                                                                         Rule r1,
                                                                                                                         Rule r2,
                                                                                                                         Graph overlapGraph)

XwriteObject

public void XwriteObject(XMLHelper h)
Writes the contents of this object to a file in a xml format.

Specified by:
XwriteObject in interface XMLObject
Parameters:
h - A helper object for storing.

XreadObject

public void XreadObject(XMLHelper h)
Reads the contents of a xml file to restore this object.

Specified by:
XreadObject in interface XMLObject
Parameters:
h - A helper object for loading.

toString

public java.lang.String toString()
Provides a human readable text of the critical pairs.

Overrides:
toString in class java.lang.Object
Returns:
The text.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface PairContainer

isComputed

public boolean isComputed()
Specified by:
isComputed in interface PairContainer

isAlive

public boolean isAlive()
Specified by:
isAlive in interface PairContainer

addPairEventListener

public void addPairEventListener(ParserEventListener l)
Adds a PairEventListener.

Specified by:
addPairEventListener in interface PairContainer
Parameters:
l - The listener.

removePairEventListener

public void removePairEventListener(ParserEventListener l)
Removes a PairEventListener

Parameters:
l - The listener.

firePairEvent

protected void firePairEvent(ParserEvent event)
Sends a event to all its listeners.

Parameters:
event - The event which will be sent

enableComplete

public void enableComplete(boolean enable)

enableReduce

public void enableReduce(boolean enable)

enableReduceSameMatch

public void enableReduceSameMatch(boolean enable)

enableNACs

public void enableNACs(boolean enable)
Deprecated. replaced by setMorphismCompletionStrategy(MorphCompletionStrategy strat)

Whether NACs are enabled or not this decision is done by the NAC property bit of the morphism completion strategy: withNACs = strategy.getProperties().get(CompletionPropertyBits.NAC);


enablePACs

public void enablePACs(boolean enable)

enableConsistent

public void enableConsistent(boolean enable)

enableStrongAttrCheck

public void enableStrongAttrCheck(boolean enable)

enableEqualVariableNameOfAttrMapping

public void enableEqualVariableNameOfAttrMapping(boolean enable)

enableUseHostGraph

public void enableUseHostGraph(boolean enable,
                               Graph g,
                               MorphCompletionStrategy strat)

enableUseHostGraph

public void enableUseHostGraph(boolean enable,
                               Graph g)
Specified by:
enableUseHostGraph in interface PairContainer

useHostGraphEnabled

public boolean useHostGraphEnabled()
Specified by:
useHostGraphEnabled in interface PairContainer

getKindOfConflict

public int getKindOfConflict()
Description copied from interface: PairContainer
Returns CriticalPair.CONFLICT or CriticalPair.DEPENDENCY constant.

Specified by:
getKindOfConflict in interface PairContainer

getLayer

public LayerFunction getLayer()
Deprecated. 

Specified by:
getLayer in interface PairContainer
See Also:
PairContainer.getLayer()