edu.wpi.cs.dsrg.xmldb.xat.common.expression
Class BinArithExpressionImp

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.common.expression.BinExpressionImp
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.common.expression.BinArithExpressionImp

public class BinArithExpressionImp
extends BinExpressionImp
implements BinArithExpression

This class defines a arithmatic expression.

Since:
1.0
See Also:
Serialized Form

Fields inherited from interface edu.wpi.cs.dsrg.xmldb.xat.common.expression.BinArithExpression
DIVIDE, MINUS, MOD, MULTIPLE, PLUS
 
Constructor Summary
BinArithExpressionImp()
          The default binary arithmatic expression constructor.
BinArithExpressionImp(Expression left, Expression right)
          The binary arithmatic expression constructor.
 
Method Summary
 java.lang.Object eval(XATOperator xopOper, int[] iPositions)
          Evaluate the expression of the XATOperator.
 Expression getLeft()
          Get the left part of expression.
 Expression getRight()
          Get the right part of expression.
 int getType()
          Get the type of expression.
 void setLeft(Expression left)
          Set the left part of expression.
 void setRight(Expression right)
          Set the right part of expression.
 void setType(int type)
          Set the type of the expression.
 java.lang.String toSQL(OperatorEvaluator soe)
          Convert the expression as a SQL statement.
 java.lang.String toString()
          Output a string of this expression.
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.expression.BinExpressionImp
getRelatedColumnNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinArithExpressionImp

public BinArithExpressionImp()
The default binary arithmatic expression constructor.
Since:
1.0

BinArithExpressionImp

public BinArithExpressionImp(Expression left,
                             Expression right)
The binary arithmatic expression constructor.
Parameters:
left - The left part of binary expression.
right - The right part of binary expression.
Since:
1.0
Method Detail

eval

public java.lang.Object eval(XATOperator xopOper,
                             int[] iPositions)
Evaluate the expression of the XATOperator.
Parameters:
xopOper - The operator evaluated.
iPositions - The position of tuple in the XATTable.
Returns:
The evaluate result of expression.
Since:
1.0

getLeft

public Expression getLeft()
Get the left part of expression.
Returns:
Expression The left part of binary expression
Since:
1.0

getRight

public Expression getRight()
Get the right part of expression.
Returns:
Expression The right part of binary expression
Since:
1.0

getType

public int getType()
Get the type of expression.
Returns:
int The type of expression.
Since:
1.0

setLeft

public void setLeft(Expression left)
Set the left part of expression.
Parameters:
left - The left part of a binary expression.
Since:
1.0

setRight

public void setRight(Expression right)
Set the right part of expression.
Parameters:
left - The right part of a binary expression.
Since:
1.0

setType

public void setType(int type)
Set the type of the expression.
Specified by:
setType in interface BinArithExpression
Parameters:
type - The number used to represent the type of expression.
Since:
1.0

toSQL

public java.lang.String toSQL(OperatorEvaluator soe)
Convert the expression as a SQL statement.
Parameters:
soe - The operator evaluator for SQL generation.
Returns:
java.lang.String The converted string.
Since:
1.0

toString

public java.lang.String toString()
Output a string of this expression.
Overrides:
toString in class java.lang.Object
Returns:
String the output result.
Since:
1.0