org.d2rq.db.expr
Class Equality

java.lang.Object
  extended by org.d2rq.db.expr.Expression
      extended by org.d2rq.db.expr.BinaryOperator
          extended by org.d2rq.db.expr.Equality

public class Equality
extends BinaryOperator

An expression that is TRUE iff its two constituent expressions are true.

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
 
Fields inherited from class org.d2rq.db.expr.BinaryOperator
expr1, expr2, operator
 
Fields inherited from class org.d2rq.db.expr.Expression
FALSE, TRUE
 
Method Summary
static Expression create(Expression expr1, Expression expr2)
           
static Expression createColumnEquality(ColumnName column1, ColumnName column2)
           
static Expression createColumnValue(ColumnName column, String value, DataType dataType)
           
static Expression createExpressionValue(Expression expression, String value, DataType dataType)
           
 boolean isConstantColumn(ColumnName column, boolean constIfTrue, boolean constIfFalse, boolean constIfConstantValue)
          Checks whether this expression forces a given column to be a constant, that is, have the same value everywhere.
 boolean isFalse()
           
 boolean isTrue()
           
 Expression rename(Renamer columnRenamer)
           
 
Methods inherited from class org.d2rq.db.expr.BinaryOperator
equals, getColumns, getDataType, hashCode, isConstant, toSQL, toString
 
Methods inherited from class org.d2rq.db.expr.Expression
and, or
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static Expression create(Expression expr1,
                                Expression expr2)

createColumnEquality

public static Expression createColumnEquality(ColumnName column1,
                                              ColumnName column2)

createColumnValue

public static Expression createColumnValue(ColumnName column,
                                           String value,
                                           DataType dataType)

createExpressionValue

public static Expression createExpressionValue(Expression expression,
                                               String value,
                                               DataType dataType)

isFalse

public boolean isFalse()
Overrides:
isFalse in class BinaryOperator

isTrue

public boolean isTrue()
Overrides:
isTrue in class BinaryOperator

isConstantColumn

public boolean isConstantColumn(ColumnName column,
                                boolean constIfTrue,
                                boolean constIfFalse,
                                boolean constIfConstantValue)
Description copied from class: Expression
Checks whether this expression forces a given column to be a constant, that is, have the same value everywhere. For example, T.COL1=5 forces T.COL1 to be constant if the expression is assumed to be true; T.COL1+1 forces it to be constant if the expression is assumed to evaluate to a constant value. Exactly one of the three constXXX arguments must be true, the other two must be false.

Overrides:
isConstantColumn in class BinaryOperator
Parameters:
column - The column to be checked
constIfTrue - Is the column constant assuming the expression evaluates to true?
constIfFalse - Is the column constant assuming the expression evaluates to false?
constIfConstantValue - Is column constant assuming the expression evaluates to a value equal to some constant?

rename

public Expression rename(Renamer columnRenamer)
Specified by:
rename in class Expression