visidia.rule
Class Rule

java.lang.Object
  extended by visidia.rule.Rule

public class Rule
extends java.lang.Object


Field Summary
protected  Star after
           
protected  Star befor
           
protected  RuleVector forbContexts
           
protected  boolean simpleRule
           
protected  int type
           
 
Constructor Summary
Rule()
          default constructor. default values are defined in class: Star, RuleVector
Rule(Star b, Star a)
          a constructor a Rule without forbidden contexts.
Rule(Star b, Star a, RuleVector fc)
           
 
Method Summary
 Star after()
          return the star after.
 Star befor()
          return the star before
 java.lang.Object clone()
          clones the rule.
 int defaultSynchDegree()
          this method returns an integer RDV LC1 RDV_LC1 or LC2, indicating witch synchronization algorithms are supported by the rule.
 boolean equals(Rule r)
          return true if the rules are equals. warning: forbidden contexts are not compared.
 RuleVector forbContexts()
          return the RuleVector of forbidden contexts.
 int getType()
          return the type of the rule. possible types are defined in class SynCT.
 Rule inverseSimpleRule()
          return the inverse of a simple rule. example: A-N --> U-V {fc} becomes N-A --> V-U {fc}
 boolean isApplicableTo(Star neighbourhood)
          this method decides if the rule can be applied to the context neighborhood.
 boolean isSimpleRule()
          return true if the rule is simple, false otherwise.
 void setSimpleRule(boolean b)
          sets the kind of rule, tue if simple, false if not simple.
 void setType(int t)
          sets the type of the rule. possible values are defined in class SynCT. no verification is done.
 java.lang.String toString()
           
 boolean withForbContexts()
          this method check if the rule contains any forbidden contexts or no.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

befor

protected Star befor

after

protected Star after

forbContexts

protected RuleVector forbContexts

type

protected int type

simpleRule

protected boolean simpleRule
Constructor Detail

Rule

public Rule()
default constructor. default values are defined in class: Star, RuleVector


Rule

public Rule(Star b,
            Star a)
a constructor a Rule without forbidden contexts.


Rule

public Rule(Star b,
            Star a,
            RuleVector fc)
Parameters:
b - the star before
a - the star after
fc - a RuleVector of forbidden contexts.
Method Detail

befor

public Star befor()
return the star before


after

public Star after()
return the star after.


forbContexts

public RuleVector forbContexts()
return the RuleVector of forbidden contexts.


withForbContexts

public boolean withForbContexts()
this method check if the rule contains any forbidden contexts or no.

Returns:
true if the rule contains any forbidden context, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setType

public void setType(int t)
sets the type of the rule. possible values are defined in class SynCT. no verification is done.


getType

public int getType()
return the type of the rule. possible types are defined in class SynCT.


isSimpleRule

public boolean isSimpleRule()
return true if the rule is simple, false otherwise.


setSimpleRule

public void setSimpleRule(boolean b)
sets the kind of rule, tue if simple, false if not simple.


equals

public boolean equals(Rule r)
return true if the rules are equals. warning: forbidden contexts are not compared. (out of model).

Parameters:
r - rule.

defaultSynchDegree

public int defaultSynchDegree()
this method returns an integer RDV LC1 RDV_LC1 or LC2, indicating witch synchronization algorithms are supported by the rule.

Returns:
RDV if only RDV is possible (resp LC1, LC2). RDV_LC1 if both RDV_LC1 are possibles. the LC2 algorithm is supposed to be acceptable.

isApplicableTo

public boolean isApplicableTo(Star neighbourhood)
this method decides if the rule can be applied to the context neighborhood.

Parameters:
neighbourhood - the context.
Returns:
true if rule is applicable, false if it isn't.

inverseSimpleRule

public Rule inverseSimpleRule()
return the inverse of a simple rule. example: A-N --> U-V {fc} becomes N-A --> V-U {fc}


clone

public java.lang.Object clone()
clones the rule.

Overrides:
clone in class java.lang.Object