Class SyntaxConditionGrader


public class SyntaxConditionGrader extends SyntaxConditionCountGrader
A grader to test whether exactly the specified number of parse nodes satisfy a predicate.
  • Constructor Details

    • SyntaxConditionGrader

      public SyntaxConditionGrader(String name, int count, String countedName, double maxScore, Predicate<com.github.javaparser.ast.Node> predicate)
      Creates a grader to test whether the specified number of parse nodes satisfy the predicate.
      Parameters:
      name - the name of this grader
      count - the desired count,
      countedName - the name of the element being checked
      maxScore - the score if the condition holds
      predicate - the condition
      Throws:
      ClientException - if count is negative
    • SyntaxConditionGrader

      public SyntaxConditionGrader(int count, String countedName, double maxScore, Predicate<com.github.javaparser.ast.Node> predicate)
      Creates a grader with a default name to test whether any parse nodes satisfy the predicate.
      Parameters:
      count - the desired count,
      countedName - the name of the element being checked
      maxScore - the score if the condition holds
      predicate - the condition
      Throws:
      ClientException - if count is negative