|
||||||||||
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
public class NodeModel
To represent the nodes in the expression tree
Field Summary |
---|
Constructor Summary | |
---|---|
NodeModel()
|
Method Summary | |
---|---|
void |
classifyNodes(java.util.Vector operatorVector,
java.util.Vector operandVector)
Does an in-order traversal of the view tree (to preserve left to right order) and adds operators to operatorVector, and leaf operands to operandVector |
java.lang.Object |
clone()
Returns a bitwise/shallow copy of this node |
boolean |
contentEquals(NodeModel right)
Method returns true if this NodeModel's conntet is the same as the content of the right NodeModel, and false otherwise |
boolean |
contentEquals(NodeModel rightOp,
int depth)
|
Value |
evaluate()
|
void |
explain(java.util.Vector explanation,
java.util.Vector errors)
Base Method to be overridden by those of Operand and Operator |
java.lang.String |
getContent()
|
NodeModel |
getLeftChild()
|
java.lang.String |
getNonRecursiveContent()
Return just the sub-expression corresponding to this node |
int |
getOrder()
|
int |
getPosition()
|
java.lang.String |
getRecursiveContent()
|
NodeModel |
getRightChild()
|
java.util.Vector |
getSideEffects()
Returns the side effects for this nodemodel - used only in Assignment right now |
NodeModel |
getStudentCopy()
Method returns a copy of this node with only shareable values, i.e., content and position resetting the others, i.e., left, right, value and order - Method used by StudentNodeModel to make a copy of the correct node for the student's answer |
Value |
getValue()
|
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 |
void |
insertInOrder(NodeModel obj)
|
void |
recursiveSetValue(java.lang.String inValue)
Do not call this function directly, call NodeModel.skip() or NodeModel.shortCircuit() instead. |
void |
setLeftChild(NodeModel child)
Method used by StudentNodeView to recreate student's answer's model |
void |
setOrder(int inOrder)
Method used by StudentNodeView to set the order in student's answer's model |
void |
setPosition(int inPosition)
|
void |
setRightChild(NodeModel child)
Method used by StudentNodeView to recreate student's answer's model |
void |
setValue(java.lang.String result)
|
void |
shortCircuit()
|
void |
skip()
|
java.lang.String |
subExpToString()
Prints this subexpression - the operator and its two operands |
java.lang.String |
toString()
Returns a string representation of this node |
boolean |
valueEquals(NodeModel right)
Method returns true if this NodeModel's value is the same as the value of the right NodeModel, and false otherwise |
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 NodeModel()
Method Detail |
---|
public java.lang.Object clone()
clone
in class DomainModel
public java.lang.String getRecursiveContent()
public java.lang.String getNonRecursiveContent()
public java.lang.String getContent()
public Value getValue()
public int getPosition()
public NodeModel getLeftChild()
public NodeModel getRightChild()
public int getOrder()
public boolean valueEquals(NodeModel right)
public boolean contentEquals(NodeModel right)
public boolean contentEquals(NodeModel rightOp, int depth)
public void classifyNodes(java.util.Vector operatorVector, java.util.Vector operandVector)
public java.util.Vector getSideEffects()
public void setPosition(int inPosition)
public void insertInOrder(NodeModel obj)
public void shortCircuit()
public void skip()
public void recursiveSetValue(java.lang.String inValue)
public void setValue(java.lang.String result)
public NodeModel getStudentCopy()
public void setLeftChild(NodeModel child)
public void setRightChild(NodeModel child)
public void setOrder(int inOrder)
public Value evaluate()
public void explain(java.util.Vector explanation, java.util.Vector errors)
public boolean grade(java.lang.String actualTemplate, java.lang.String studentCode, java.util.Vector explanation)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String subExpToString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |