Class StatementCountGrader


public class StatementCountGrader extends ExpressionStatementCountGrader
A counter to test whether the number of occurrences of a given statement type is within the specified range.
  • Constructor Details

    • StatementCountGrader

      public StatementCountGrader(String name, double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.stmt.Statement> clazz)
      Creates a new counter with the given name to test whether the number of occurrences of the statement type is within the specified range.
      Parameters:
      name - the name of this processor (for the Result)
      maxScore - the score if the condition holds
      minCount - the minimum number of occurrences, which must be non-negative
      maxCount - the maximum number of occurrences, or Integer.MAX_VALUE if there is no limit
      clazz - the statement class
      Throws:
      ClientException - if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount is Integer.MAX_VALUE
    • StatementCountGrader

      public StatementCountGrader(double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.stmt.Statement> clazz)
      Creates a new counter with a default name to test whether the number of occurrences of the statement type is within the specified range.
      Parameters:
      maxScore - the score if the condition holds
      minCount - the minimum number of occurrences, which must be non-negative
      maxCount - the maximum number of occurrences, or Integer.MAX_VALUE if there is no limit
      clazz - the statement class
      Throws:
      ClientException - if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount is Integer.MAX_VALUE