Class ExpressionStatementCountGrader

Direct Known Subclasses:
ExpressionCountGrader, StatementCountGrader

public class ExpressionStatementCountGrader extends SyntaxConditionCountGrader
A grader to test whether the number of occurrences of the given expression and statement types are in the specified numeric range.
  • Constructor Details

    • ExpressionStatementCountGrader

      public ExpressionStatementCountGrader(String name, String countedName, double maxScore, int minCount, int maxCount, List<Class<? extends com.github.javaparser.ast.expr.Expression>> expressionClasses, List<Class<? extends com.github.javaparser.ast.stmt.Statement>> statementClasses)
      Creates a grader to test whether the number of occurrences of the given expression and statement types are in the specified numeric range.
      Parameters:
      name - the name of this grader
      countedName - a brief description of the elements being counted
      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
      expressionClasses - the expression classes
      statementClasses - the statement classes
      Throws:
      ClientException - if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount is Integer.MAX_VALUE