Class SyntaxConditionGrader
java.lang.Object
com.spertus.jacquard.common.Grader
com.spertus.jacquard.syntaxgrader.SyntaxGrader
com.spertus.jacquard.syntaxgrader.SyntaxCountGrader
com.spertus.jacquard.syntaxgrader.SyntaxConditionCountGrader
com.spertus.jacquard.syntaxgrader.SyntaxConditionGrader
A grader to test whether exactly the specified number of parse nodes
satisfy a predicate.
-
Constructor Summary
ConstructorDescriptionSyntaxConditionGrader
(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.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. -
Method Summary
Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxCountGrader
getResult, grade
Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxGrader
getCallableSingleTarget
Methods inherited from class com.spertus.jacquard.common.Grader
getCallableMultiTarget, grade, grade, gradeAll, makeExceptionResult, makeExceptionResultList, makeFailureResult, makeFailureResultList, makePartialCreditResult, makeSuccessResult, makeSuccessResultList
-
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 gradercount
- the desired count,countedName
- the name of the element being checkedmaxScore
- the score if the condition holdspredicate
- the condition- Throws:
ClientException
- ifcount
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 checkedmaxScore
- the score if the condition holdspredicate
- the condition- Throws:
ClientException
- ifcount
is negative
-