|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.domain.model.DomainModel
org.problets.domain.model.expression.node.NodeModel
org.problets.domain.model.expression.node.operator.Operator
org.problets.domain.model.expression.node.operator.arithmetic.Arithmetic
public class Arithmetic
To hold all constants specific to arithmetic operators
Field Summary | |
---|---|
static int |
TOTAL_OPERATORS
|
Fields inherited from class org.problets.domain.model.expression.node.operator.Operator |
---|
INCORRECT_OPERAND_COUNT |
Method Summary | |
---|---|
Value |
evaluate()
Checks that arithmetic operators are not applied to boolean operands in Java/C# |
void |
explain(java.util.Vector explanation,
java.util.Vector errors)
If the result is not an error, the operator is not modulus, and one operand is an integer whereas the other is real, add an explanation for coercion. |
Value |
getCoercedValue(Value leftValue,
Value rightValue,
java.lang.String result)
Method does arithmetic conversions so that the result is stored in an object of the correct data type Arithmetic conversions are defined as follows: --If either operand is long double, result is long double. |
void |
getLocalLearningObjectives(java.util.Vector learnObjVector)
Overrides Operator.getLocalLearningObjectives(). |
java.lang.String |
getQualifiedLearningObject()
Method returns the name of the operator, disambiguated enough so that it can be easily credited in the student model. |
Methods inherited from class org.problets.domain.model.expression.node.operator.Operator |
---|
clone, coerceToReal, contentEquals, contentEquals, getArity, getAssociativity, getOperatorType, getPrecedence, getStudentCopy, getSymbol, grade, locateOperator, main, recursiveContentEquals, recursiveSetValue |
Methods inherited from class org.problets.domain.model.expression.node.NodeModel |
---|
classifyNodes, getContent, getLeftChild, getNonRecursiveContent, getOrder, getPosition, getRecursiveContent, getRightChild, getSideEffects, getValue, insertInOrder, setLeftChild, setOrder, setPosition, setRightChild, setValue, shortCircuit, skip, subExpToString, toString, valueEquals |
Methods inherited from class org.problets.domain.model.DomainModel |
---|
getId, getIdName, grade |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TOTAL_OPERATORS
Method Detail |
---|
public void getLocalLearningObjectives(java.util.Vector learnObjVector)
getLocalLearningObjectives
in class Operator
public java.lang.String getQualifiedLearningObject()
getQualifiedLearningObject
in class Operator
public Value evaluate()
evaluate
in class Operator
public void explain(java.util.Vector explanation, java.util.Vector errors)
explain
in class Operator
public Value getCoercedValue(Value leftValue, Value rightValue, java.lang.String result)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |