org.problets.domain.model.expression.node.operator.assignment
Class Assignment

java.lang.Object
  extended by org.problets.domain.model.DomainModel
      extended by org.problets.domain.model.expression.node.NodeModel
          extended by org.problets.domain.model.expression.node.operator.Operator
              extended by org.problets.domain.model.expression.node.operator.assignment.Assignment
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Assign, CompoundAssignment, PostfixAssignment, PrefixAssignment

public class Assignment
extends Operator
implements java.lang.Cloneable

To hold all constants specific to assignment operators

Author:
Amruth Kumar

Field Summary
static int TOTAL_OPERATORS
           
 
Fields inherited from class org.problets.domain.model.expression.node.operator.Operator
INCORRECT_OPERAND_COUNT
 
Fields inherited from class org.problets.domain.model.DomainModel
BOOLEAN, BREAKPOINT, CHARACTER, DOUBLE_PRECISION_REAL, ERROR_TYPE, EVAL_STATUS, expACTION, expASSIGNMENT, expAUTO_DEALLOCATION, expCALL, expCONDITION, expDECLARATION, expDEREFERENCING, expDYNAMIC_ALLOCATION, expDYNAMIC_ALLOCATION_INITIALIZATION, expDYNAMIC_DEALLOCATION, expELSE_CLAUSE, expERROR, expEXECUTION, expIF_CLAUSE, expINITIALIZATION, expINPUT, expPARAMETER_PASSING, expPRINT, expQUESTIONABLE, expREFERENCING, expRETURN, expRUNTIME_ERROR, expSEMANTIC_ERROR, expSYNTAX_ERROR, expUPDATE, IDENTITY, MAX_OBJECT_IDENTITY, MIN_OBJECT_IDENTITY, QUADRUPLE_PRECISION_REAL, RUNTIME_ERROR, SEMANTIC_ERROR, SIGNED_INTEGER, SIGNED_LONG, SIGNED_SHORT, SINGLE_PRECISION_REAL, SYNTAX_ERROR, UNDEFINED_TYPE, UNSIGNED_INTEGER, UNSIGNED_LONG, UNSIGNED_SHORT, WARNING
 
Method Summary
 void addSideEffects(java.util.Vector inSideEffectVector)
          Adds side-effects specified by the user to this operator
 java.lang.Object clone()
          Returns a bitwise/shallow copy of this node
 Value evaluate()
          Method to detect any errors before subclasses evaluate expressions Not to be used by client.
 java.util.Vector getSideEffects()
          Returns the side effects for this nodemodel
 NodeModel getStudentCopy()
          Method returns a copy of this node with only shareable values, resetting the others - Method used by StudentNodeModel to make a copy of the correct node for the student's answer
 
Methods inherited from class org.problets.domain.model.expression.node.operator.Operator
coerceToReal, contentEquals, contentEquals, explain, getArity, getAssociativity, getLocalLearningObjectives, getOperatorType, getPrecedence, getQualifiedLearningObject, 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, 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

TOTAL_OPERATORS

public static final int TOTAL_OPERATORS
See Also:
Constant Field Values
Method Detail

clone

public java.lang.Object clone()
Description copied from class: Operator
Returns a bitwise/shallow copy of this node

Overrides:
clone in class Operator

getSideEffects

public java.util.Vector getSideEffects()
Returns the side effects for this nodemodel

Overrides:
getSideEffects in class NodeModel

getStudentCopy

public NodeModel getStudentCopy()
Method returns a copy of this node with only shareable values, resetting the others - Method used by StudentNodeModel to make a copy of the correct node for the student's answer

Overrides:
getStudentCopy in class Operator

addSideEffects

public void addSideEffects(java.util.Vector inSideEffectVector)
Adds side-effects specified by the user to this operator


evaluate

public Value evaluate()
Method to detect any errors before subclasses evaluate expressions Not to be used by client. Checks if LHS is a variable, and RHS evaluates correctly

Overrides:
evaluate in class Operator