Class ExpressionCountGrader
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.ExpressionStatementCountGrader
com.spertus.jacquard.syntaxgrader.ExpressionCountGrader
A grader to test whether the number of occurrences of a given expression
type is within the specified range.
-
Constructor Summary
ConstructorDescriptionExpressionCountGrader
(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.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. -
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
-
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 theResult
)maxScore
- the score if the condition holdsminCount
- the minimum number of occurrencesmaxCount
- the maximum number of occurrences, orInteger.MAX_VALUE
if there is no limitclazz
- the expression class- Throws:
ClientException
- if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount isInteger.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 holdsminCount
- the minimum number of occurrencesmaxCount
- the maximum number of occurrences, orInteger.MAX_VALUE
if there is no limitclazz
- the expression class- Throws:
ClientException
- if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount isInteger.MAX_VALUE
-