dragon.ir.query
Class SimpleExpression

java.lang.Object
  |
  +--dragon.ir.query.AbstractExpression
        |
        +--dragon.ir.query.SimpleExpression
All Implemented Interfaces:
Expression

public class SimpleExpression
extends AbstractExpression

Simple expression

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
 
Fields inherited from class dragon.ir.query.AbstractExpression
expressionType, optr
 
Fields inherited from interface dragon.ir.query.Expression
EXPRESSION_BOOL, EXPRESSION_SIMPLE
 
Constructor Summary
SimpleExpression(java.lang.String[] expression)
           
SimpleExpression(java.lang.String field, Operator optr, java.lang.Object testValue)
           
 
Method Summary
 Expression getChild(int index)
          This method returns null for simple expressions.
 int getChildNum()
          This method returns zero for simple expressions.
 java.lang.String getField()
           
 Operator getOperator()
           
 java.lang.Object getTestValue()
           
 java.lang.String toSQLExpression()
           
 java.lang.String toString()
           
 
Methods inherited from class dragon.ir.query.AbstractExpression
isBoolExpression, isSimpleExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleExpression

public SimpleExpression(java.lang.String field,
                        Operator optr,
                        java.lang.Object testValue)

SimpleExpression

public SimpleExpression(java.lang.String[] expression)
Method Detail

getChildNum

public int getChildNum()
Description copied from interface: Expression
This method returns zero for simple expressions. It returns the number of conditions for bool expression.

Returns:
the number of sub-expressions

getChild

public Expression getChild(int index)
Description copied from interface: Expression
This method returns null for simple expressions. It returns index-th conditions for bool expression.

Parameters:
index - the index of the child expression
Returns:
the specified child expression

toSQLExpression

public java.lang.String toSQLExpression()
Returns:
a string for SQL-formatted expression

toString

public java.lang.String toString()
Specified by:
toString in interface Expression
Overrides:
toString in class java.lang.Object
Returns:
a string for the expression

getField

public java.lang.String getField()

getTestValue

public java.lang.Object getTestValue()

getOperator

public Operator getOperator()
Specified by:
getOperator in interface Expression
Overrides:
getOperator in class AbstractExpression