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;

  /*
  * Creates a rule run for all tests.
  */
  public RuleRun(List<String> params) {
    this(-1, 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 = testId;
    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 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;
  }

}

@@ -347,16 +347,47 @@
  params;
+%0A  final private String suffix;
 %0A%0A  /*%0A 
@@ -480,16 +480,22 @@
 this(-1,
+ null,
  params)
@@ -500,18 +500,16 @@
 s);%0A  %7D%0A
-%0A 
  %0A  /*%0A 
@@ -707,32 +707,368 @@
 ring%3E params) %7B%0A
+    this(testId, null, params);%0A  %7D%0A%0A  /*%0A  * Creates a rule run for a specific test.%0A  * @param testId The test identifier attached%0A  * @param suffix The specific suffix attached to the run (maybe null)%0A  * @param params The list if parameter values for this run%0A  */%0A  public RuleRun(int testId, String suffix, List%3CString%3E params) %7B%0A
     this.testId 
@@ -1073,24 +1073,50 @@
 d = testId;%0A
+    this.suffix = suffix;%0A
     this.par
@@ -1128,21 +1128,27 @@
  params;
+    
 %0A  %7D%0A
+  
 %0A  /*%0A  
@@ -1518,24 +1518,399 @@
 %0A    %7D%0A  %7D%0A%0A
+  /*%0A  * Returns true if the run has a specific suffix.  %0A  * @return Returns true if the run has a specific suffix%0A  */%0A  public boolean hasSuffix() %7B    %0A    return this.suffix != null;%0A  %7D%0A  %0A  /*%0A  * Returns the specific suffix attached to the run.%0A  * @return The specific suffix attached to the run%0A  */%0A  public String getSuffix() %7B    %0A    return this.suffix;%0A  %7D%0A  %0A
   /*%0A  * Ret
@@ -1957,18 +1957,16 @@
 is run.%0A
-  
   * @ret

add suffix property to rule run