|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.SqlOperator org.eigenbase.sql.SqlSpecialOperator org.eigenbase.sql.fun.SqlLikeOperator
public class SqlLikeOperator
An operator describing the LIKE
and SIMILAR
operators.
Syntax of the two operators:
src-value [NOT] LIKE pattern-value [ESCAPE
escape-value]
src-value [NOT] SIMILAR pattern-value [ESCAPE
escape-value]
NOTE If the NOT
clause is present the parser
will generate a eqvivalent to
NOT (src LIKE pattern ...)
Field Summary | |
---|---|
private boolean |
negated
|
Fields inherited from class org.eigenbase.sql.SqlOperator |
---|
MaxPrec, NL |
Constructor Summary | |
---|---|
SqlLikeOperator(String name,
SqlKind kind,
boolean negated)
Creates a SqlLikeOperator. |
Method Summary | |
---|---|
boolean |
checkOperandTypes(SqlCallBinding callBinding,
boolean throwOnFailure)
Checks that the operand values in a SqlCall to this operator are
valid. |
SqlOperandCountRange |
getOperandCountRange()
Returns a constraint on the number of operands expected by this operator. |
boolean |
isNegated()
Returns whether this is the 'NOT LIKE' operator. |
int |
reduceExpr(int opOrdinal,
List<Object> list)
Reduces a list of operators and arguments according to the rules of precedence and associativity. |
void |
unparse(SqlWriter writer,
SqlNode[] operands,
int leftPrec,
int rightPrec)
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence. |
Methods inherited from class org.eigenbase.sql.SqlSpecialOperator |
---|
getSyntax |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final boolean negated
Constructor Detail |
---|
SqlLikeOperator(String name, SqlKind kind, boolean negated)
name
- Operator namekind
- Kindnegated
- Whether this is 'NOT LIKE'Method Detail |
---|
public boolean isNegated()
public SqlOperandCountRange getOperandCountRange()
SqlOperator
SqlOperandTypeChecker
associated with this
operator.
getOperandCountRange
in class SqlOperator
public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
SqlOperator
SqlCall
to this operator are
valid. Subclasses must either override this method or supply an instance
of SqlOperandTypeChecker
to the constructor.
checkOperandTypes
in class SqlOperator
callBinding
- description of callthrowOnFailure
- whether to throw an exception if check fails
(otherwise returns false in that case)
public void unparse(SqlWriter writer, SqlNode[] operands, int leftPrec, int rightPrec)
SqlOperator
The default implementation of this method delegates to SqlSyntax.unparse(org.eigenbase.sql.SqlWriter, org.eigenbase.sql.SqlOperator, org.eigenbase.sql.SqlNode[], int, int)
.
unparse
in class SqlSpecialOperator
public int reduceExpr(int opOrdinal, List<Object> list)
SqlSpecialOperator
The default implementation throws UnsupportedOperationException
.
reduceExpr
in class SqlSpecialOperator
opOrdinal
- indicating the ordinal of the current operator in the list
on which a possible reduction can be madelist
- List of alternating SqlParserUtil.ToTreeListItem
and SqlNode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |