Class ExpressionStatementCountGrader
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
- Direct Known Subclasses:
ExpressionCountGrader,StatementCountGrader
A grader to test whether the number of occurrences of the given
expression and statement types are in the specified numeric range.
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionStatementCountGrader(String name, String countedName, double maxScore, int minCount, int maxCount, List<Class<? extends com.github.javaparser.ast.expr.Expression>> expressionClasses, List<Class<? extends com.github.javaparser.ast.stmt.Statement>> statementClasses) Creates a grader to test whether the number of occurrences of the given expression and statement types are in the specified numeric range. -
Method Summary
Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxCountGrader
getResult, gradeMethods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxGrader
getCallableSingleTargetMethods inherited from class com.spertus.jacquard.common.Grader
getCallableMultiTarget, grade, grade, gradeAll, makeExceptionResult, makeExceptionResultList, makeFailureResult, makeFailureResultList, makePartialCreditResult, makeSuccessResult, makeSuccessResultList
-
Constructor Details
-
ExpressionStatementCountGrader
public ExpressionStatementCountGrader(String name, String countedName, double maxScore, int minCount, int maxCount, List<Class<? extends com.github.javaparser.ast.expr.Expression>> expressionClasses, List<Class<? extends com.github.javaparser.ast.stmt.Statement>> statementClasses) Creates a grader to test whether the number of occurrences of the given expression and statement types are in the specified numeric range.- Parameters:
name- the name of this gradercountedName- a brief description of the elements being countedmaxScore- the score if the condition holdsminCount- the minimum number of occurrences, which must be non-negativemaxCount- the maximum number of occurrences, orInteger.MAX_VALUEif there is no limitexpressionClasses- the expression classesstatementClasses- the statement classes- Throws:
ClientException- if minCount < 0, maxCount < minCount, or minCount is 0 when maxCount isInteger.MAX_VALUE
-