visidia.rule
Class RelabelingSystem

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

public class RelabelingSystem
extends java.lang.Object

Relabeling System.


Field Summary
protected  java.lang.String description
           
protected  RuleVector rules
           
 RSOptions userPreferences
           
 
Constructor Summary
RelabelingSystem()
          default constructor.
RelabelingSystem(java.util.Collection rulesCollection)
          constructor from a collection of rules.
 
Method Summary
 void addGlobEndRule(Rule r)
          add a Global End rule to the relabeling system.
 void addRule(Rule r)
          add a rule to the relabeling system.
 int checkForRule(Star n)
          check if any rule is applicable to the context n. returns the position of the rule, -1 if no rule is applicable .
 java.lang.Object clone()
          clones the relabeling system (including options).
 int defaultSynchronisation()
          this methode returns an integer RDV LC1 RDV_LC1 or LC2, indicating witch synchronisation algorithms are supported by this relabeling system.
 int dupplicateSimpleRules(int synType)
          this methode create and add the symetric of a simple Rule (if not exists). it respects caracteristics of synchronisation algorithm on use.
 java.lang.String getDescription()
          get a help.
 RSOptions getOptions()
          returns the options.
 Rule getRule(int i)
          return the rule at position i.
 java.util.Iterator getRules()
          return an iterator of rules.
 void resetOptions()
          restore the default options.
 void setDescription(java.lang.String txt)
          set a help text concerning the relabeling system.
 void setOptions(RSOptions opt)
          sets the options.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

description

protected java.lang.String description

rules

protected RuleVector rules

userPreferences

public RSOptions userPreferences
Constructor Detail

RelabelingSystem

public RelabelingSystem()
default constructor.


RelabelingSystem

public RelabelingSystem(java.util.Collection rulesCollection)
constructor from a collection of rules. Options are affected to default values defined in class RSOptions.

Parameters:
rulesCollection - the collection of rules.
Method Detail

setOptions

public void setOptions(RSOptions opt)
sets the options.

Parameters:
opt - the object describing options.

resetOptions

public void resetOptions()
restore the default options.


dupplicateSimpleRules

public int dupplicateSimpleRules(int synType)
this methode create and add the symetric of a simple Rule (if not exists). it respects caracteristics of synchronisation algorithm on use.

Parameters:
synType - indicates the synchronisation algorithm to respect.
Returns:
the number of rules dupplicated.

defaultSynchronisation

public int defaultSynchronisation()
this methode returns an integer RDV LC1 RDV_LC1 or LC2, indicating witch synchronisation algorithms are supported by this relabeling system.

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.

getOptions

public RSOptions getOptions()
returns the options.

Returns:
options.

toString

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

addRule

public void addRule(Rule r)
add a rule to the relabeling system.

Parameters:
r - the rule to add.

addGlobEndRule

public void addGlobEndRule(Rule r)
add a Global End rule to the relabeling system.

Parameters:
r - the rule to add.

getRules

public java.util.Iterator getRules()
return an iterator of rules.


getRule

public Rule getRule(int i)
return the rule at position i.

Parameters:
i - position
Returns:
the rule.

clone

public java.lang.Object clone()
clones the relabeling system (including options).

Overrides:
clone in class java.lang.Object

setDescription

public void setDescription(java.lang.String txt)
set a help text concerning the relabeling system.

Parameters:
txt -

getDescription

public java.lang.String getDescription()
get a help.

Returns:
the help text.

checkForRule

public int checkForRule(Star n)
check if any rule is applicable to the context n. returns the position of the rule, -1 if no rule is applicable .

Parameters:
n - a context.
Returns:
the number of the rule, -1 if no rule is applicable.