Venice 0.7beta

org.mov.parser.expression
Class LogicExpression

java.lang.Object
  extended by org.mov.parser.expression.AbstractExpression
      extended by org.mov.parser.expression.BinaryExpression
          extended by org.mov.parser.expression.LogicExpression
All Implemented Interfaces:
java.lang.Cloneable, Expression
Direct Known Subclasses:
AndExpression, OrExpression

public abstract class LogicExpression
extends BinaryExpression

Abstract base class for the boolean expressions: and, or


Field Summary
 
Fields inherited from interface org.mov.parser.Expression
BOOLEAN_TYPE, FALSE, FLOAT_QUOTE_TYPE, FLOAT_TYPE, INTEGER_QUOTE_TYPE, INTEGER_TYPE, STRING_TYPE, TRUE, TRUE_LEVEL
 
Constructor Summary
LogicExpression(Expression left, Expression right)
          Create a new logic expression with the given left and right arguments.
 
Method Summary
 int checkType()
          Check the input arguments to the expression.
 int getType()
          Get the type of the expression.
protected  java.lang.String toString(java.lang.String operator)
          Helper method to conver the given expression to a string.
 
Methods inherited from class org.mov.parser.expression.BinaryExpression
getChildCount
 
Methods inherited from class org.mov.parser.expression.AbstractExpression
clone, equals, getChild, getIndex, getNumberFormat, getParent, hashCode, isRoot, iterator, parseDouble, parseInt, setChild, setParent, simplify, size, size, valueOfDouble, valueOfInt
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mov.parser.Expression
evaluate, toString
 

Constructor Detail

LogicExpression

public LogicExpression(Expression left,
                       Expression right)
Create a new logic expression with the given left and right arguments.

Method Detail

checkType

public int checkType()
              throws TypeMismatchException
Check the input arguments to the expression. They must both be Expression.BOOLEAN_TYPE.

Returns:
Expression.BOOLEAN_TYPE
Throws:
TypeMismatchException - if the expression has incorrect types

getType

public int getType()
Get the type of the expression.

Returns:
Expression.BOOLEAN_TYPE.

toString

protected java.lang.String toString(java.lang.String operator)
Helper method to conver the given expression to a string. Given an operator such as and, or etc it will return arg1 operator arg2. It will insert parentheses as needed.

Overrides:
toString in class BinaryExpression
Parameters:
operator - the binary operator
Returns:
the string representation

Venice 0.7beta