Class ExpressionCountGrader


public class ExpressionCountGrader extends ExpressionStatementCountGrader
A grader to test whether the number of occurrences of a given expression type is within the specified range.
  • Constructor Details

    • ExpressionCountGrader

      public ExpressionCountGrader(String name, double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.expr.Expression> clazz)
      Creates a new grader with the given name to test whether the number of occurrences of an expression 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
      maxCount - the maximum number of occurrences, or Integer.MAX_VALUE if there is no limit
      clazz - the expression class
      Throws:
      ClientException - if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount is Integer.MAX_VALUE
    • ExpressionCountGrader

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