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

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

public class BinCOMPExpressionImp
extends BinExpressionImp
implements BinCOMPExpression

This class defines a binary comparision expression.

Since:
1.0
See Also:
Serialized Form

Fields inherited from interface edu.wpi.cs.dsrg.xmldb.xat.common.expression.BinCOMPExpression
EQ, GEQ, GT, LEQ, LT, NEQ
 
Constructor Summary
BinCOMPExpressionImp()
          The default binary expression constructor.
BinCOMPExpressionImp(Expression left, Expression right)
          The binary expression constructor.
 
Method Summary
 java.lang.Boolean compAtomic(java.lang.Object left, java.lang.Object right)
          Execute the eval function for atomic values
 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

BinCOMPExpressionImp

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

BinCOMPExpressionImp

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

compAtomic

public java.lang.Boolean compAtomic(java.lang.Object left,
                                    java.lang.Object right)
Execute the eval function for atomic values
Parameters:
left - java.lang.Object The left part of expression.
right - java.lang.Object The right part of expression.
Returns:
boolean The comparison result.
Since:
1.0

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 BinCOMPExpression
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