|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is an abstraction of a relational operator. It was created for optimization, to allow binary comparison operators and IS NULL to be treated the same.
Field Summary | |
static int |
EQUALS_RELOP
|
static int |
GREATER_EQUALS_RELOP
|
static int |
GREATER_THAN_RELOP
|
static int |
IS_NOT_NULL_RELOP
|
static int |
IS_NULL_RELOP
|
static int |
LESS_EQUALS_RELOP
|
static int |
LESS_THAN_RELOP
|
static int |
NOT_EQUALS_RELOP
|
Method Summary | |
boolean |
compareWithKnownConstant(Optimizable optTable,
boolean considerParameters)
Return whether this operator compares the given Optimizable with a constant whose value is known at compile time. |
boolean |
equalsComparisonWithConstantExpression(Optimizable optTable)
Return whether this operator is an equality comparison of the given optimizable with a constant expression. |
void |
generateAbsoluteColumnId(MethodBuilder mb,
Optimizable optTable)
Generate the absolute column id for the ColumnReference that appears on one side of this RelationalOperator or the other, and that refers to the given table. |
void |
generateExpressionOperand(Optimizable optTable,
int columnPosition,
ExpressionClassBuilder acb,
MethodBuilder mb)
Check whether this RelationalOperator is a comparison of the given column with an expression. |
void |
generateNegate(MethodBuilder mb,
Optimizable optTable)
Generate an expression that evaluates to true if the result of the comparison should be negated. |
void |
generateOperator(MethodBuilder mb,
Optimizable optTable)
Generate the comparison operator for this RelationalOperator. |
void |
generateOrderedNulls(MethodBuilder mb)
Generate an expression that evaluates to true if this RelationalOperator uses ordered null semantics, false if it doesn't. |
void |
generateQualMethod(ExpressionClassBuilder acb,
MethodBuilder mb,
Optimizable optTable)
Generate the method to evaluate a Qualifier. |
void |
generateRelativeColumnId(MethodBuilder mb,
Optimizable optTable)
Generate the relative column id for the ColumnReference that appears on one side of this RelationalOperator or the other, and that refers to the given table. |
ColumnReference |
getColumnOperand(int tableNumber,
int columnPosition)
Check whether this RelationalOperator is a comparison of the given column with an expression. |
ColumnReference |
getColumnOperand(Optimizable optTable)
Get the ColumnReference for the given table on one side of this RelationalOperator. |
ColumnReference |
getColumnOperand(Optimizable optTable,
int columnPosition)
Check whether this RelationalOperator is a comparison of the given column with an expression. |
DataValueDescriptor |
getCompareValue(Optimizable optTable)
Return an Object representing the known value that this relational operator is comparing to a column in the given Optimizable. |
ValueNode |
getExpressionOperand(int tableNumber,
int columnPosition)
Check whether this RelationalOperator is a comparison of the given column with an expression. |
int |
getOperator()
Return the operator (as an int) for this RelationalOperator. |
int |
getOrderableVariantType(Optimizable optTable)
Return the variant type for the Qualifier's Orderable. |
int |
getStartOperator(Optimizable optTable)
Get the start operator for a scan (at the store level) for this RelationalOperator. |
int |
getStopOperator(Optimizable optTable)
Get the stop operator for a scan (at the store level) for this RelationalOperator. |
RelationalOperator |
getTransitiveSearchClause(ColumnReference otherCR)
Return a relational operator which matches the current one but with the passed in ColumnReference as the (left) operand. |
boolean |
isQualifier(Optimizable optTable)
Return true if this operator can be compiled into a Qualifier for the given Optimizable table. |
boolean |
orderedNulls()
Return true if this operator uses ordered null semantics |
boolean |
selfComparison(ColumnReference cr)
Check whether this RelationalOperator compares the given ColumnReference to any columns in the same table as the ColumnReference. |
boolean |
usefulStartKey(Optimizable optTable)
Tell whether this relop is a useful start key for the given table. |
boolean |
usefulStopKey(Optimizable optTable)
Tell whether this relop is a useful stop key for the given table. |
Field Detail |
public static final int EQUALS_RELOP
public static final int NOT_EQUALS_RELOP
public static final int GREATER_THAN_RELOP
public static final int GREATER_EQUALS_RELOP
public static final int LESS_THAN_RELOP
public static final int LESS_EQUALS_RELOP
public static final int IS_NULL_RELOP
public static final int IS_NOT_NULL_RELOP
Method Detail |
public ColumnReference getColumnOperand(Optimizable optTable, int columnPosition)
optTable
- An Optimizable for the base table the column is incolumnPosition
- The ordinal position of the column (one-based)
public ColumnReference getColumnOperand(int tableNumber, int columnPosition)
tableNumber
- The table number of the table in questioncolumnPosition
- The ordinal position of the column (one-based)
public ColumnReference getColumnOperand(Optimizable optTable)
public ValueNode getExpressionOperand(int tableNumber, int columnPosition)
tableNumber
- The table number of the base table the column is incolumnPosition
- The ordinal position of the column (one-based)
public void generateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
optTable
- An Optimizable for the base table the column is incolumnPosition
- The ordinal position of the column (one-based)acb
- The ExpressionClassBuilder for the class we're buildingmb
- The method the expression will go into
StandardException
- Thrown on errorpublic boolean selfComparison(ColumnReference cr) throws StandardException
cr
- The ColumnReference that is being compared to some
expression.
StandardException
- Thrown on errorpublic boolean usefulStartKey(Optimizable optTable)
optTable
- The Optimizable table for which we want to know
whether this is a useful start key.
public boolean usefulStopKey(Optimizable optTable)
optTable
- The Optimizable table for which we want to know
whether this is a useful stop key.
public int getStartOperator(Optimizable optTable)
optTable
- The optimizable table we're doing the scan on.
This parameter is so we can tell which side of
the operator the table's column is on.
TransactionController.openScan(long, boolean, int, int, int, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.types.DataValueDescriptor[], int)
public int getStopOperator(Optimizable optTable)
optTable
- The optimizable table we're doing the scan on.
This parameter is so we can tell which side of
the operator the table's column is on.
TransactionController.openScan(long, boolean, int, int, int, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.types.DataValueDescriptor[], int)
public void generateAbsoluteColumnId(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The optimizable table we're doing the scan on.public void generateRelativeColumnId(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The optimizable table we're doing the scan on.public void generateOperator(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The optimizable table we're doing the scan on.public void generateQualMethod(ExpressionClassBuilder acb, MethodBuilder mb, Optimizable optTable) throws StandardException
acb
- The ExpressionClassBuilder for the class we're buildingmb
- The method the generated code is to go intooptTable
- The Optimizable table the Qualifier will qualify
StandardException
- Thrown on error.public void generateOrderedNulls(MethodBuilder mb)
mb
- The method the generated code is to go intopublic void generateNegate(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The Optimizable table the Qualifier will qualifypublic boolean orderedNulls()
public boolean isQualifier(Optimizable optTable) throws StandardException
optTable
- The Optimizable table in question.
StandardException
- Thrown on errorpublic int getOperator()
public int getOrderableVariantType(Optimizable optTable) throws StandardException
optTable
- The Optimizable table the Qualifier will qualify
StandardException
- thrown on errorpublic boolean compareWithKnownConstant(Optimizable optTable, boolean considerParameters)
public DataValueDescriptor getCompareValue(Optimizable optTable) throws StandardException
StandardException
- Thrown on errorpublic boolean equalsComparisonWithConstantExpression(Optimizable optTable)
public RelationalOperator getTransitiveSearchClause(ColumnReference otherCR) throws StandardException
otherCR
- The ColumnReference for the new (left) operand.
StandardException
- Thrown on error
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |