package innovimax.mixthem;

import innovimax.mixthem.arguments.Rule;

import java.util.List;

/**
* <p>Describes a specific test run for a rule.</p>
* <p>Depends on the rule, test runs may have some parameter values or not.</p>
* @author Innovimax
* @version 1.0
*/
public class RuleRun {

  final private int testId;
  final private List<String> params;
  final private String suffix;

  /*
  * Creates a rule run for all tests.
  */
  public RuleRun(List<String> params) {
    this(-1, null, params);
  }
 
  /*
  * Creates a rule run for a specific test.
  * @param testId The test identifier attached
  * @param params The list if parameter values for this run
  */
  public RuleRun(int testId, List<String> params) {
    this(testId, null, params);
  }

  /*
  * Creates a rule run for a specific test.
  * @param testId The test identifier attached
  * @param suffix The specific suffix attached to the run (maybe null)
  * @param params The list if parameter values for this run
  */
  public RuleRun(int testId, String suffix, List<String> params) {
    this.testId = testId;
    this.suffix = suffix;
    this.params = params;    
  }
  
  /*
  * Returns true if the test is authorized for the run.
  * @param testId The test identifier attached
  * @param params The list if parameter values for this run
  * @return Returns true if the test is authorized for the run
  */
  public boolean accept(int testId) {
    if (this.testId == -1) {
      return true;
    } else {
      return this.testId == testId;
    }
  }

  /*
  * Returns true if the run has a specific suffix.  
  * @return Returns true if the run has a specific suffix
  */
  public boolean hasSuffix() {    
    return this.suffix != null;
  }
  
  /*
  * Returns the specific suffix attached to the run.
  * @return The specific suffix attached to the run
  */
  public String getSuffix() {    
    return this.suffix;
  }
  
  /*
  * Returns the list of parameter values for this run.
  * @return Returns the list of parameter values for this run.
  */
  public List<String> getParams() {
    return this.params;
  }

}

@@ -56,20 +56,113 @@
 guments.
-Rule
+ParamValue;%0Aimport innovimax.mixthem.arguments.Rule;%0Aimport innovimax.mixthem.arguments.RuleParam
 ;%0A%0Aimpor
@@ -173,20 +173,19 @@
 va.util.
-List
+Map
 ;%0A%0A/**%0A*
@@ -395,47 +395,33 @@
 ate 
-int testId;%0A  final private List%3CString
+Map%3CRuleParam, ParamValue
 %3E pa
@@ -462,130 +462,8 @@
 x;%0A%0A
-  /*%0A  * Creates a rule run for all tests.%0A  */%0A  public RuleRun(List%3CString%3E params) %7B%0A    this(-1, null, params);%0A  %7D%0A %0A
   /*
@@ -510,55 +510,10 @@
 est.
-%0A
   
-* @param testId The test identifier attached
 %0A  *
@@ -528,33 +528,33 @@
 params The list 
-i
+o
 f parameter valu
@@ -595,31 +595,33 @@
 Run(
-int testId, List%3CString
+Map%3CRuleParam, ParamValue
 %3E pa
@@ -637,24 +637,16 @@
    this(
-testId, 
 null, pa
@@ -710,55 +710,8 @@
 st.%0A
-  * @param testId The test identifier attached%0A
   * 
@@ -796,33 +796,33 @@
 params The list 
-i
+o
 f parameter valu
@@ -863,20 +863,8 @@
 Run(
-int testId, 
 Stri
@@ -874,27 +874,41 @@
 suffix, 
-List%3CString
+Map%3CRuleParam, ParamValue
 %3E params
@@ -914,34 +914,12 @@
 s) %7B
-%0A
     
-this.testId = testId;
 %0A   
@@ -982,390 +982,8 @@
 %0A  %0A
-  /*%0A  * Returns true if the test is authorized for the run.%0A  * @param testId The test identifier attached%0A  * @param params The list if parameter values for this run%0A  * @return Returns true if the test is authorized for the run%0A  */%0A  public boolean accept(int testId) %7B%0A    if (this.testId == -1) %7B%0A      return true;%0A    %7D else %7B%0A      return this.testId == testId;%0A    %7D%0A  %7D%0A%0A
   /*
@@ -1470,25 +1470,24 @@
 for this run
-.
 %0A  */%0A  publ
@@ -1493,19 +1493,33 @@
 lic 
-List%3CString
+Map%3CRuleParam, ParamValue
 %3E ge

Update RuleRun.java