|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.query.sql.lang.Criteria
com.metamatrix.query.sql.lang.PredicateCriteria
com.metamatrix.query.sql.lang.MatchCriteria
public class MatchCriteria
This class represents a criteria involving a string expression to be matched against a string expression match value. The match value may contain a few special characters: % represents 0 or more characters and _ represents a single match character. The escape character can be used to escape an actual % or _ within a match string.
Nested Class Summary | |
---|---|
static class |
MatchCriteria.PatternTranslator
Utility to convert the pattern into a different match syntax |
Field Summary | |
---|---|
static char |
MATCH_CHAR
The default single match character - '_' |
static char |
NULL_ESCAPE_CHAR
The internal null escape character |
static char |
WILDCARD_CHAR
The default wildcard character - '%' |
Constructor Summary | |
---|---|
MatchCriteria()
Constructs a default instance of this class. |
|
MatchCriteria(Expression leftExpression,
Expression rightExpression)
Constructs an instance of this class from a left and right expression |
|
MatchCriteria(Expression leftExpression,
Expression rightExpression,
char escapeChar)
Constructs an instance of this class from a left and right expression and an escape character |
Method Summary | |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor. |
java.lang.Object |
clone()
Deep copy of object |
boolean |
equals(java.lang.Object obj)
Override equals() method. |
char |
getEscapeChar()
Get the escape character, which can be placed before the wildcard or single match character in the expression to prevent it from being used as a wildcard or single match. |
Expression |
getLeftExpression()
Get left expression. |
Expression |
getRightExpression()
Get right expression. |
int |
hashCode()
Get hash code. |
boolean |
isNegated()
Returns whether this criteria is negated. |
void |
setEscapeChar(char escapeChar)
Set the escape character which can be used when the wildcard or single character should be used literally. |
void |
setLeftExpression(Expression expression)
Set left expression. |
void |
setNegated(boolean negationFlag)
Sets the negation flag for this criteria. |
void |
setRightExpression(Expression expression)
Set right expression. |
Methods inherited from class com.metamatrix.query.sql.lang.Criteria |
---|
combineCriteria, combineCriteria, combineCriteria, separateCriteriaByAnd, toConjunctiveNormalForm, toDisjunctiveNormalForm, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char WILDCARD_CHAR
public static final char MATCH_CHAR
public static final char NULL_ESCAPE_CHAR
Constructor Detail |
---|
public MatchCriteria()
public MatchCriteria(Expression leftExpression, Expression rightExpression)
leftExpression
- The expression to checkrightExpression
- The match expressionpublic MatchCriteria(Expression leftExpression, Expression rightExpression, char escapeChar)
leftExpression
- The expression to checkrightExpression
- The match expressionescapeChar
- The escape character, to allow literal use of wildcard and single match charsMethod Detail |
---|
public void setLeftExpression(Expression expression)
expression
- expressionpublic Expression getLeftExpression()
public void setRightExpression(Expression expression)
expression
- expressionpublic Expression getRightExpression()
public char getEscapeChar()
NULL_ESCAPE_CHAR
public void setEscapeChar(char escapeChar)
escapeChar
- New escape characterpublic boolean isNegated()
public void setNegated(boolean negationFlag)
negationFlag
- true if this criteria contains a NOT; false otherwisepublic void acceptVisitor(LanguageVisitor visitor)
LanguageObject
visitor
- Visitor being usedpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Other object
public java.lang.Object clone()
clone
in interface LanguageObject
clone
in class PredicateCriteria
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |