Class StatementCountGrader
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.StatementCountGrader
A counter to test whether the number of occurrences of a given statement
type is within the specified range.
-
Constructor Summary
ConstructorDescriptionStatementCountGrader
(double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.stmt.Statement> clazz) Creates a new counter with a default name to test whether the number of occurrences of the statement type is within the specified range.StatementCountGrader
(String name, double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.stmt.Statement> clazz) Creates a new counter with the given name to test whether the number of occurrences of the statement 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
-
StatementCountGrader
public StatementCountGrader(String name, double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.stmt.Statement> clazz) Creates a new counter with the given name to test whether the number of occurrences of the statement 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 occurrences, which must be non-negativemaxCount
- the maximum number of occurrences, orInteger.MAX_VALUE
if there is no limitclazz
- the statement class- Throws:
ClientException
- if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount isInteger.MAX_VALUE
-
StatementCountGrader
public StatementCountGrader(double maxScore, int minCount, int maxCount, Class<? extends com.github.javaparser.ast.stmt.Statement> clazz) Creates a new counter with a default name to test whether the number of occurrences of the statement type is within the specified range.- Parameters:
maxScore
- the score if the condition holdsminCount
- the minimum number of occurrences, which must be non-negativemaxCount
- the maximum number of occurrences, orInteger.MAX_VALUE
if there is no limitclazz
- the statement class- Throws:
ClientException
- if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount isInteger.MAX_VALUE
-