org.problets.domain.model.expression.node.operator.relational
Class LessThan

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.relational.Relational
                  extended by org.problets.domain.model.expression.node.operator.relational.LessThan
All Implemented Interfaces:
java.lang.Cloneable

public class LessThan
extends Relational

To represent less than operator

Author:
Joshua Go, Amruth Kumar

Field Summary
static java.lang.String SYMBOL
           
 
Fields inherited from class org.problets.domain.model.expression.node.operator.relational.Relational
MIXED_OPERANDS, 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
 
Constructor Summary
LessThan()
           
 
Method Summary
 Value evaluate()
          In Java/C#, <, <=, >, and >= cannot be applied to boolean operands.
 
Methods inherited from class org.problets.domain.model.expression.node.operator.relational.Relational
explain, getQualifiedLearningObject
 
Methods inherited from class org.problets.domain.model.expression.node.operator.Operator
clone, coerceToReal, contentEquals, contentEquals, getArity, getAssociativity, getLocalLearningObjectives, 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

SYMBOL

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

LessThan

public LessThan()
Method Detail

evaluate

public Value evaluate()
Description copied from class: Relational
In Java/C#, <, <=, >, and >= cannot be applied to boolean operands. == and != can be applied as long as both the operands are boolean. This is being handled here in one shot for all the relational operators although this code could be moved into the 6 different classes for true object-orientation.

Overrides:
evaluate in class Relational