org.problets.domain.model.expression.step
Class ExpressionStep

java.lang.Object
  extended by org.problets.domain.line.AbstractLine
      extended by org.problets.domain.line.AbstractExplanationLine
          extended by org.problets.domain.model.expression.step.AbstractExpressionStep
              extended by org.problets.domain.model.expression.step.ExpressionStep
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
IncorrectExpressionStep

public class ExpressionStep
extends AbstractExpressionStep

To hold one step in the solution to an expression

Author:
Amruth Kumar

Field Summary
static java.lang.String NO_VALUE
           
static java.lang.String SPACE
           
 
Fields inherited from class org.problets.domain.line.AbstractLine
UNASSIGNED_LINE
 
Constructor Summary
ExpressionStep(java.lang.String inMessage, int inOrder)
          Constructor for ExpressionStep - used for post-expression message
ExpressionStep(java.lang.String inExpression, int inOrder, java.lang.String inResult)
          Constructor for ExpressionStep - used for subexpressions
 
Method Summary
 void appendPostExplanation(java.lang.String inExplanation)
           
 void appendPreExplanation(java.lang.String inExplanation)
          Adds inExplanation at the end of the explanation that appears before the expression
 boolean equals(ExpressionStep parameter)
          Method returns true of the expression, its result and its order are the same
 boolean equalsModuloOrder(ExpressionStep parameter)
          Method returns true of this step is the same as the parameter except for the order
 java.lang.String getPostExplanation()
           
 java.lang.String getStep()
          Returns the string "expression = result"
 void prependPostExplanation(java.lang.String inExplanation)
           
 void print()
          Prints all the fields of the class
 java.lang.String toString()
          Returns only that which is entered into the log
 
Methods inherited from class org.problets.domain.model.expression.step.AbstractExpressionStep
getOrder, getResult, replaceTagDelimiters, setOrder, setResult
 
Methods inherited from class org.problets.domain.line.AbstractExplanationLine
getEvent, getExplainer, getFeedbackAmount, setFeedbackAmount
 
Methods inherited from class org.problets.domain.line.AbstractLine
clone, getLineNumber, setLineNumber
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SPACE

public static final java.lang.String SPACE
See Also:
Constant Field Values

NO_VALUE

public static final java.lang.String NO_VALUE
See Also:
Constant Field Values
Constructor Detail

ExpressionStep

public ExpressionStep(java.lang.String inExpression,
                      int inOrder,
                      java.lang.String inResult)
Constructor for ExpressionStep - used for subexpressions


ExpressionStep

public ExpressionStep(java.lang.String inMessage,
                      int inOrder)
Constructor for ExpressionStep - used for post-expression message

Method Detail

getStep

public java.lang.String getStep()
Returns the string "expression = result"


equals

public boolean equals(ExpressionStep parameter)
Method returns true of the expression, its result and its order are the same


equalsModuloOrder

public boolean equalsModuloOrder(ExpressionStep parameter)
Method returns true of this step is the same as the parameter except for the order


getPostExplanation

public java.lang.String getPostExplanation()

appendPreExplanation

public void appendPreExplanation(java.lang.String inExplanation)
Adds inExplanation at the end of the explanation that appears before the expression

Parameters:
inExplanation - - the explanation string to be appended

appendPostExplanation

public void appendPostExplanation(java.lang.String inExplanation)

prependPostExplanation

public void prependPostExplanation(java.lang.String inExplanation)

print

public void print()
Description copied from class: AbstractExplanationLine
Prints all the fields of the class

Overrides:
print in class AbstractExpressionStep

toString

public java.lang.String toString()
Description copied from class: AbstractExplanationLine
Returns only that which is entered into the log

Overrides:
toString in class AbstractExpressionStep