com.ibm.dse.tools.workbench.base
Class CompositionRule

java.lang.Object
  |
  +--com.ibm.dse.tools.workbench.base.CompositionRule

public class CompositionRule
extends java.lang.Object

This class is used to group the entity composition rules that correspond to the same component entities It acts as a group of counters


Field Summary
protected  int max
          The maximum number of uses of the component entity established by the rule
protected  int min
          The minimum number of uses of the component entity established by the rule
protected  int used
          The number of uses of the component entity in the instance
 
Constructor Summary
CompositionRule()
          This method constructs a CompositionRule object with no allowed occurrences of component entity
CompositionRule(char modifier)
          This method constructs a CompositionRule object initialized with a rule
 
Method Summary
 void addModifier(char modifier)
          This method adds a rule increasing the corresponding counters
 java.lang.String check()
          This method checks the correctness of the instance components count based on rule
 int getMax()
          Returns the maximum number of ocurrences
 int getMin()
          Returns the minimum number of ocurrences
 void increaseUsed()
          This method counts a new use of an entity in the composition of an instance
 void initialize()
          This method initilizes the counting for checking an instance composition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

used

protected int used
The number of uses of the component entity in the instance

min

protected int min
The minimum number of uses of the component entity established by the rule

max

protected int max
The maximum number of uses of the component entity established by the rule
Constructor Detail

CompositionRule

public CompositionRule()
This method constructs a CompositionRule object with no allowed occurrences of component entity

CompositionRule

public CompositionRule(char modifier)
This method constructs a CompositionRule object initialized with a rule
Parameters:
modifier - char
Method Detail

addModifier

public void addModifier(char modifier)
This method adds a rule increasing the corresponding counters
Parameters:
modifier - char

check

public java.lang.String check()
This method checks the correctness of the instance components count based on rule
Returns:
java.lang.String The error message

getMax

public int getMax()
Returns the maximum number of ocurrences
Returns:
int

getMin

public int getMin()
Returns the minimum number of ocurrences
Returns:
int

increaseUsed

public void increaseUsed()
This method counts a new use of an entity in the composition of an instance

initialize

public void initialize()
This method initilizes the counting for checking an instance composition