|
||||||||||
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.operand.Operand
org.problets.domain.model.expression.node.operand.VarOperand
public class VarOperand
VarOperand To hold a variable operand
Field Summary |
---|
Constructor Summary | |
---|---|
VarOperand(AbstractVarModel inValue)
|
Method Summary | |
---|---|
boolean |
canAssign()
Returns whether this node is assignable |
Value |
evaluate()
This overrides the method declared in NodeModel - and always returns the original value of the variable |
void |
explain(java.util.Vector explanation,
java.util.Vector errors)
Base Method to be overridden by those of Operand and Operator |
AbstractVarModel |
getClone()
Returns a clone of the variable that is this operand for purposes of re-creating the current expression as student's attempted answer in StudentNodeView. |
Value |
getValue()
This overrides the method declared in NodeModel - and always returns the value of the variable's clone. |
AbstractVarModel |
getVarReference()
Returns a reference to the variable that is this operand. |
boolean |
grade(java.lang.String actualTemplate,
java.lang.String studentCode,
java.util.Vector explanation)
Grades the studentCode according to the actualTemplate, returns true if correct, and false otherwise |
static void |
main(java.lang.String[] args)
|
void |
setVarValue(Value inValue)
Sets the value of the variable which is this operand. |
Methods inherited from class org.problets.domain.model.expression.node.NodeModel |
---|
classifyNodes, clone, contentEquals, contentEquals, getContent, getLeftChild, getNonRecursiveContent, getOrder, getPosition, getRecursiveContent, getRightChild, getSideEffects, getStudentCopy, insertInOrder, recursiveSetValue, 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 |
Constructor Detail |
---|
public VarOperand(AbstractVarModel inValue)
Method Detail |
---|
public AbstractVarModel getVarReference()
getVarReference
in interface Assignable
public AbstractVarModel getClone()
getClone
in interface Assignable
public Value getValue()
getValue
in class NodeModel
public boolean canAssign()
canAssign
in interface Assignable
public void setVarValue(Value inValue)
setVarValue
in interface Assignable
public boolean grade(java.lang.String actualTemplate, java.lang.String studentCode, java.util.Vector explanation)
grade
in class Operand
public Value evaluate()
evaluate
in class NodeModel
public void explain(java.util.Vector explanation, java.util.Vector errors)
NodeModel
explain
in class NodeModel
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |