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

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

public class TerminalExpressionImp
extends java.lang.Object
implements TerminalExpression

This class defines a terminal expression.

Since:
1.0
See Also:
Serialized Form

Fields inherited from interface edu.wpi.cs.dsrg.xmldb.xat.common.expression.TerminalExpression
BOOL, DOUBLE, NAME, STRING
 
Constructor Summary
TerminalExpressionImp()
          The default TerminalExpressionImp constructor.
TerminalExpressionImp(boolean bValue)
          The default TerminalExpressionImp constructor using a boolean value.
TerminalExpressionImp(java.lang.Boolean bValue)
          The default TerminalExpressionImp constructor using a boolean object.
TerminalExpressionImp(ColumnName cnValue)
          The default TerminalExpressionImp constructor using a column name object.
TerminalExpressionImp(double dValue)
          The default TerminalExpressionImp constructor using a double value.
TerminalExpressionImp(java.lang.Double dValue)
          The default TerminalExpressionImp constructor using a Double object.
TerminalExpressionImp(java.lang.String sValue)
          The default TerminalExpressionImp constructor using a String object.
 
Method Summary
 java.lang.Object eval(XATOperator xopOper, int[] iPositions)
          Evaluate the expression of the XATOperator.
 ColumnName[] getRelatedColumnNames()
          get column names related with expression.
 int getType()
          Get the type of expression.
 java.lang.Object getValue()
          Get the value of this expression.
 void setType(int type)
          Set the type of the expression.
 void setValue(boolean bValue)
          Set the value of this expression using given boolean value.
 void setValue(ColumnName cnValue)
          Set the column name value for this terminal expression.
 void setValue(double dValue)
          Set the double value for this terminal expression.
 void setValue(java.lang.String sValue)
          Set the string value for this terminal 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TerminalExpressionImp

public TerminalExpressionImp()
The default TerminalExpressionImp constructor.
Since:
1.0

TerminalExpressionImp

public TerminalExpressionImp(double dValue)
The default TerminalExpressionImp constructor using a double value.
Parameters:
dValue - The double value used to construct the terminal expression.
Since:
1.0

TerminalExpressionImp

public TerminalExpressionImp(ColumnName cnValue)
The default TerminalExpressionImp constructor using a column name object.
Parameters:
cnValue - The Column Name object used to construct the terminal expression.
Since:
1.0

TerminalExpressionImp

public TerminalExpressionImp(java.lang.Boolean bValue)
The default TerminalExpressionImp constructor using a boolean object.
Parameters:
bValue - The boolean object used to construct the terminal expression.
Since:
1.0

TerminalExpressionImp

public TerminalExpressionImp(java.lang.Double dValue)
The default TerminalExpressionImp constructor using a Double object.
Parameters:
dValue - The Double object used to construct the terminal expression.
Since:
1.0

TerminalExpressionImp

public TerminalExpressionImp(java.lang.String sValue)
The default TerminalExpressionImp constructor using a String object.
Parameters:
sValue - The String object used to construct the terminal expression.
Since:
1.0

TerminalExpressionImp

public TerminalExpressionImp(boolean bValue)
The default TerminalExpressionImp constructor using a boolean value.
Parameters:
bValue - The boolean value used to construct the terminal 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

getRelatedColumnNames

public ColumnName[] getRelatedColumnNames()
get column names related with expression.
Returns:
ColumnName[] The array containing all the related column names.
Since:
1.0

getType

public int getType()
Get the type of expression.
Specified by:
getType in interface TerminalExpression
Returns:
int The type of expression.
Since:
1.0

getValue

public java.lang.Object getValue()
Get the value of this expression.
Specified by:
getValue in interface TerminalExpression
Returns:
Object The value of this expression.
Since:
1.0

setType

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

setValue

public void setValue(double dValue)
Set the double value for this terminal expression.
Specified by:
setValue in interface TerminalExpression
Parameters:
value - The double value of this expression.
Since:
1.0

setValue

public void setValue(ColumnName cnValue)
Set the column name value for this terminal expression.
Specified by:
setValue in interface TerminalExpression
Parameters:
value - The column name value of this expression.
Since:
1.0

setValue

public void setValue(java.lang.String sValue)
Set the string value for this terminal expression.
Specified by:
setValue in interface TerminalExpression
Parameters:
value - The string value of this expression.
Since:
1.0

setValue

public void setValue(boolean bValue)
Set the value of this expression using given boolean value.
Specified by:
setValue in interface TerminalExpression
Returns:
Object The boolean value for this 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