|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.types.Like
Like matching algorithm. Not too speedy for %s. SQL92 says the escape character can only and must be followed by itself, %, or _. So if you choose % or _ as the escape character, you can no longer do that sort of matching. Not the most recent Like -- missing the unit tests
Field Summary | |
private static char |
anyChar
|
private static char |
anyString
|
private static java.lang.String |
SUPER_STRING
|
Constructor Summary | |
private |
Like()
|
Method Summary | |
(package private) static java.lang.Boolean |
checkLengths(int vLoc,
int vEnd,
int pLoc,
char[] pat,
int pEnd)
checkLengths -- non-national chars Returns null if we are not done. |
(package private) static java.lang.Boolean |
checkLengths(int vLoc,
int vEnd,
int pLoc,
int[] pat,
int pEnd,
int[] anyStringInts)
checkLengths -- national chars Returns null if we are not done. |
(package private) static int |
getMinLen(char[] pattern,
int pStart,
int pEnd,
boolean haveEsc,
char escChar)
Calculate the shortest length string that could match this pattern for non-national chars |
(package private) static int |
getMinLen(int[] pattern,
int pStart,
int pEnd,
boolean haveEsc,
int[] escCharInts,
int[] anyStringInts)
Calculate the shortest length string that could match this pattern for national chars |
private static java.lang.String |
greaterEqualString(java.lang.String pattern,
char escChar)
greaterEqualString -- for Escape clause only Walk the pattern character by character |
static java.lang.String |
greaterEqualString(java.lang.String pattern,
java.lang.String escape)
Return the substring from the pattern for the optimization >= clause. |
static java.lang.String |
greaterEqualStringFromParameter(java.lang.String pattern)
|
static java.lang.String |
greaterEqualStringFromParameterWithEsc(java.lang.String pattern,
java.lang.String escape)
|
static boolean |
isLikeComparisonNeeded(java.lang.String pattern)
Return whether or not the like comparison is still needed after performing the like transformation on a constant string. |
static boolean |
isOptimizable(java.lang.String pattern)
Determine whether or not this LIKE can be transformed into optimizable clauses. |
static java.lang.String |
lessThanString(java.lang.String pattern)
Return the substring from the pattern for the < clause. |
static java.lang.String |
lessThanString(java.lang.String pattern,
java.lang.String escape)
Return the substring from the pattern for the < clause. |
static java.lang.String |
lessThanStringFromParameter(java.lang.String pattern)
|
static java.lang.String |
lessThanStringFromParameterWithEsc(java.lang.String pattern,
java.lang.String escape)
|
static java.lang.Boolean |
like(char[] value,
int valueLength,
char[] pattern,
int patternLength)
|
static java.lang.Boolean |
like(char[] val,
int valLength,
char[] pat,
int patLength,
char[] escape,
int escapeLength)
|
private static java.lang.Boolean |
like(char[] val,
int vLoc,
int vEnd,
char[] pat,
int pLoc,
int pEnd,
char[] escape,
int escapeLength)
|
static java.lang.Boolean |
like(int[] val,
int valLength,
int[] pat,
int patLength,
int[] escape,
int escapeLength,
java.text.RuleBasedCollator collator)
For national chars. |
static java.lang.Boolean |
like(int[] value,
int valueLength,
int[] pattern,
int patternLength,
java.text.RuleBasedCollator collator)
|
private static java.lang.Boolean |
like(int[] val,
int vLoc,
int vEnd,
int[] pat,
int pLoc,
int pEnd,
int[] escape,
int escapeLength,
java.text.RuleBasedCollator collator)
|
private static boolean |
matchSpecial(int[] pat,
int patStart,
int patEnd,
int[] specialInts)
matchSpecial check the pattern against the various special character arrays. |
static java.lang.String |
stripEscapesNoPatternChars(java.lang.String pattern,
char escChar)
stripEscapesNoPatternChars |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final char anyChar
private static final char anyString
private static final java.lang.String SUPER_STRING
Constructor Detail |
private Like()
Method Detail |
public static java.lang.Boolean like(char[] val, int valLength, char[] pat, int patLength, char[] escape, int escapeLength) throws StandardException
val
- value to compare. if null, result is null.valLength
- length of valpat
- pattern to compare. if null, result is null.patLength
- length of patescape
- escape character. Must be 1 char long.
if null, no escape character is used.escapeLength
- length of escape
StandardException
- thrown if data invalidpublic static java.lang.Boolean like(int[] val, int valLength, int[] pat, int patLength, int[] escape, int escapeLength, java.text.RuleBasedCollator collator) throws StandardException
val
- value to compare. if null, result is null.valLength
- length of valpat
- pattern to compare. if null, result is null.patLength
- length of patescape
- escape character. Must be 1 char long.
if null, no escape character is used.escapeLength
- length of escapecollator
- The collator to use.
StandardException
- thrown if data invalidprivate static java.lang.Boolean like(char[] val, int vLoc, int vEnd, char[] pat, int pLoc, int pEnd, char[] escape, int escapeLength) throws StandardException
StandardException
private static java.lang.Boolean like(int[] val, int vLoc, int vEnd, int[] pat, int pLoc, int pEnd, int[] escape, int escapeLength, java.text.RuleBasedCollator collator) throws StandardException
StandardException
static int getMinLen(char[] pattern, int pStart, int pEnd, boolean haveEsc, char escChar)
static int getMinLen(int[] pattern, int pStart, int pEnd, boolean haveEsc, int[] escCharInts, int[] anyStringInts)
static java.lang.Boolean checkLengths(int vLoc, int vEnd, int pLoc, char[] pat, int pEnd)
vLoc
- current index into char[] valvEnd
- end index or our valuepLoc
- current index into our char[] patternpat
- pattern char []pEnd
- end index of our pattern []static java.lang.Boolean checkLengths(int vLoc, int vEnd, int pLoc, int[] pat, int pEnd, int[] anyStringInts)
vLoc
- current index into int[] valvEnd
- end index or our valuepLoc
- current index into our int[] patternpat
- pattern int []pEnd
- end index of our pattern []private static boolean matchSpecial(int[] pat, int patStart, int patEnd, int[] specialInts)
public static java.lang.Boolean like(char[] value, int valueLength, char[] pattern, int patternLength) throws StandardException
StandardException
public static java.lang.Boolean like(int[] value, int valueLength, int[] pattern, int patternLength, java.text.RuleBasedCollator collator) throws StandardException
StandardException
public static boolean isOptimizable(java.lang.String pattern)
pattern
- The right side of the LIKE
public static java.lang.String greaterEqualStringFromParameter(java.lang.String pattern) throws StandardException
StandardException
public static java.lang.String greaterEqualStringFromParameterWithEsc(java.lang.String pattern, java.lang.String escape) throws StandardException
StandardException
public static java.lang.String greaterEqualString(java.lang.String pattern, java.lang.String escape) throws StandardException
pattern
- The right side of the LIKEescape
- The escape clause
StandardException
private static java.lang.String greaterEqualString(java.lang.String pattern, char escChar) throws StandardException
pattern
- like pattern to build fromescChar
- the escape character in the pattern
StandardException
public static java.lang.String stripEscapesNoPatternChars(java.lang.String pattern, char escChar) throws StandardException
pattern
- pattern String to searchescChar
- the escape character
StandardException
- thrown if data invalidpublic static java.lang.String lessThanString(java.lang.String pattern) throws StandardException
pattern
- The right side of the LIKE
StandardException
- thrown if data invalidpublic static java.lang.String lessThanStringFromParameter(java.lang.String pattern) throws StandardException
StandardException
public static java.lang.String lessThanStringFromParameterWithEsc(java.lang.String pattern, java.lang.String escape) throws StandardException
StandardException
public static java.lang.String lessThanString(java.lang.String pattern, java.lang.String escape) throws StandardException
pattern
- The right side of the LIKEescape
- The escape clause
StandardException
- thrown if data invalidpublic static boolean isLikeComparisonNeeded(java.lang.String pattern)
pattern
- The right side of the LIKE
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |