亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? like.java

?? derby database source code.good for you.
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*   Derby - Class org.apache.derby.iapi.types.Like   Copyright 1999, 2004 The Apache Software Foundation or its licensors, as applicable.   Licensed under the Apache License, Version 2.0 (the "License");   you may not use this file except in compliance with the License.   You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0   Unless required by applicable law or agreed to in writing, software   distributed under the License is distributed on an "AS IS" BASIS,   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the License for the specific language governing permissions and   limitations under the License. */package org.apache.derby.iapi.types;// RESOLVE: MOVE THIS CLASS TO PROTOCOL (See LikeOperatorNode)import org.apache.derby.iapi.services.sanity.SanityManager;import org.apache.derby.iapi.error.StandardException;import org.apache.derby.iapi.reference.SQLState;import java.text.CollationElementIterator;import java.text.Collator;import java.text.RuleBasedCollator;import java.util.Locale;/**	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	@author ames */public class Like {	private static final char anyChar = '_';	private static final char anyString = '%';	private static final String SUPER_STRING = "\uffff";	private Like() { // do not instantiate	}	/**		@param val value to compare. if null, result is null.		@param valLength length of val		@param pat pattern to compare. if null, result is null.		@param patLength length of pat		@param escape escape character. Must be 1 char long.			if null, no escape character is used.		@param escapeLength length of escape		@return null if val or pat null, otherwise true if match		and false if not.		@exception StandardException thrown if data invalid	 */	public static Boolean like	(		char[] 	val, 		int 	valLength, 		char[] 	pat, 		int 	patLength, 		char[] 	escape,		int 	escapeLength	) throws StandardException 	{		return like(val, 0, valLength, pat, 0, patLength, escape, escapeLength);	}	/**		For national chars.		@param val value to compare. if null, result is null.		@param valLength length of val		@param pat pattern to compare. if null, result is null.		@param patLength length of pat		@param escape escape character. Must be 1 char long.			if null, no escape character is used.		@param escapeLength length of escape		@param collator	The collator to use.		@return null if val or pat null, otherwise true if match		and false if not.		@exception StandardException thrown if data invalid	 */	public static Boolean like	(		int[] 	val, 		int 	valLength, 		int[] 	pat, 		int 	patLength, 		int[] 	escape,		int 	escapeLength,		RuleBasedCollator collator	) throws StandardException 	{		return like(val, 0, valLength, pat, 0, patLength, escape, escapeLength, collator);	}	/* non-national chars */	private static Boolean like	(		char[] 	val, 		int 	vLoc, 	// start at val[vLoc]		int 	vEnd, 	// end at val[vEnd]		char[] 	pat, 		int 	pLoc, 	// start at pat[pLoc]		int 	pEnd, 	// end at pat[pEnd]		char[] 	escape,		int 	escapeLength	) throws StandardException 	{		char escChar = ' ';		boolean haveEsc = true;				if (val == null) return null;		if (pat == null) return null;		if (escape == null)		{			haveEsc = false;		}		else		{			escChar = escape[0];		}		Boolean result;		while (true) {			if ((result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd)) != null) 			{				return result;			}			// go until we get a special char in the pattern or hit EOS			while (pat[pLoc] != anyChar && pat[pLoc] != anyString &&					((! haveEsc) || pat[pLoc] != escChar)) {				if (val[vLoc] == pat[pLoc]) 				{					vLoc++; pLoc++;						result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd);					if (result != null) 						return result;				}				else 				{					return Boolean.FALSE;				}			}			// deal with escChar first, as it can be escaping a special char			// and can be a special char itself.			if (haveEsc && pat[pLoc] == escChar) {				pLoc++;				if (pLoc == pEnd) {					throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_SEQUENCE);				}				if (pat[pLoc] != escChar &&				    pat[pLoc] != anyChar &&				    pat[pLoc] != anyString) {					throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_SEQUENCE);				}				// regardless of the char in pat, it must match exactly:				if (val[vLoc] == pat[pLoc]) {					vLoc++; pLoc++;						result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd);					if (result != null) 						return result;				}				else return Boolean.FALSE;			}			else if (pat[pLoc] == anyChar) {				// regardless of the char, it matches				vLoc++; pLoc++;					result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd);				if (result != null) 					return result;			}			else if (pat[pLoc] == anyString) {				// catch the simple cases -- end of the pattern or of the string				if (pLoc+1 == pEnd)					return Boolean.TRUE;				// would return true, but caught in checkLengths above				if (SanityManager.DEBUG)					SanityManager.ASSERT(vLoc!=vEnd, 						"Should have been found already");				//if (vLoc == vEnd) // caught in checkLengths					//return Boolean.TRUE;				// check if remainder of pattern is anyString's				// if escChar == anyString, we couldn't be here				boolean anys = true;				for (int i=pLoc+1;i<pEnd;i++)					if (pat[i]!=anyString) {						anys=false;						break;					}				if (anys) return Boolean.TRUE;				// pattern can match 0 or more chars in value.				// to test that, we take the remainder of pattern and				// apply it to ever-shorter  remainders of value until				// we hit a match.				// the loop never continues from this point -- we will				// always generate an answer here.				// REMIND: there are smarter ways to pick the remainders				// and do this matching.				// num chars left in value includes current char				int vRem = vEnd - vLoc;				int n=0;				// num chars left in pattern excludes the anychar				int minLen = getMinLen(pat, pLoc+1, pEnd, haveEsc, escChar);				for (int i=vRem; i>=minLen; i--) 				{					Boolean restResult = Like.like(val,vLoc+n,vLoc+n+i,pat,pLoc+1,pEnd,escape,escapeLength);					if (SanityManager.DEBUG)					{						if (restResult == null)						{							String vStr = new String(val,vLoc+n,i);							String pStr = new String(pat,pLoc+1,pEnd-(pLoc+1));							SanityManager.THROWASSERT("null result on like(value = "+vStr+", pat = "+pStr+")");						}					}					if (restResult.booleanValue())						return restResult;					n++;				}				// none of the possibilities worked 				return Boolean.FALSE;			}		}	}	/* national chars */	private static Boolean like	(		int[] 	val, 		int 	vLoc, 	// start at val[vLoc]		int 	vEnd, 	// end at val[vEnd]		int[] 	pat, 		int 	pLoc, 	// start at pat[pLoc]		int 	pEnd, 	// end at pat[pEnd]		int[] 	escape,		int 	escapeLength,		RuleBasedCollator	collator	) throws StandardException 	{		int[] escCharInts = null;		boolean haveEsc = true;		int[] anyCharInts = new int[1];	// assume only 1 int		int[] anyStringInts = new int[1];	// assume only 1 int				if (val == null) return null;		if (pat == null) return null;		if (escape == null)		{			haveEsc = false;		}		else		{			escCharInts = escape;		}		Boolean result;		// get the collation integer representing "_"		CollationElementIterator cei =									collator.getCollationElementIterator("_");		anyCharInts[0] = cei.next();		{			int nextInt;			// There may be multiple ints representing this character			while ((nextInt = cei.next()) != CollationElementIterator.NULLORDER)			{				int[] temp = new int[anyCharInts.length + 1];				for (int index = 0; index < anyCharInts.length; index++)				{					temp[index] = anyCharInts[index];				}				temp[anyCharInts.length] = nextInt;				anyCharInts = temp;			}		}		// get the collation integer representing "%"		cei = collator.getCollationElementIterator("%");		anyStringInts[0] = cei.next();		{			int nextInt;			// There may be multiple ints representing this character			while ((nextInt = cei.next()) != CollationElementIterator.NULLORDER)			{				int[] temp = new int[anyStringInts.length + 1];				for (int index = 0; index < anyStringInts.length; index++)				{					temp[index] = anyStringInts[index];				}				temp[anyStringInts.length] = nextInt;				anyStringInts = temp;			}		}		while (true) 		{			// returns null if more work to do, otherwise match Boolean			result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd, anyStringInts);			if (result != null) 				return result;			// go until we get a special char in the pattern or hit EOS			while ( (! matchSpecial(pat, pLoc, pEnd, anyCharInts)) &&					(! matchSpecial(pat, pLoc, pEnd, anyStringInts)) &&					((! haveEsc)						|| (! matchSpecial(pat, pLoc, pEnd, escCharInts))))			{				if (val[vLoc] == pat[pLoc]) 				{					vLoc++; pLoc++;						result = checkLengths(vLoc, vEnd, pLoc,								pat, pEnd, anyStringInts);					if (result != null) 					{						return result;					}				}				else 				{					return Boolean.FALSE;				}			}			// deal with escCharInt first, as it can be escaping a special char			// and can be a special char itself.			if (haveEsc && matchSpecial(pat, pLoc, pEnd, escCharInts))			{				pLoc += escCharInts.length;				if (pLoc == pEnd) 				{					throw StandardException.newException(						SQLState.LANG_INVALID_ESCAPE_SEQUENCE);				}				int[] specialInts = null;				if (matchSpecial(pat, pLoc, pEnd, escCharInts))				{					specialInts = escCharInts;				}				if (matchSpecial(pat, pLoc, pEnd, anyCharInts))				{					specialInts = anyCharInts;				}				if (matchSpecial(pat, pLoc, pEnd, anyStringInts))				{					specialInts = anyStringInts;				}				if (specialInts == null)				{					throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_SEQUENCE);				}				// regardless of the char in pat, it must match exactly:				for (int index = 0; index < specialInts.length; index++)				{					if (val[vLoc + index] != pat[pLoc + index])					{						return Boolean.FALSE;					}				}				vLoc += specialInts.length; 				pLoc += specialInts.length; 					// returns null if more work to do, otherwise match Boolean				result = checkLengths(vLoc, vEnd,						pLoc, pat, pEnd, anyStringInts);				if (result != null) 					return result;			}			else if (matchSpecial(pat, pLoc, pEnd, anyCharInts))			{				// regardless of the char, it matches				vLoc += anyCharInts.length; 				pLoc += anyCharInts.length; 					result = checkLengths(vLoc, vEnd, pLoc, pat, pEnd, anyStringInts);				if (result != null) 					return result;			}			else if (matchSpecial(pat, pLoc, pEnd, anyStringInts))			{				// catch the simple cases -- end of the pattern or of the string				if (pLoc+1 == pEnd)					return Boolean.TRUE;				// would return true, but caught in checkLengths above				if (SanityManager.DEBUG)					SanityManager.ASSERT(vLoc!=vEnd, 						"Should have been found already");				if (vLoc == vEnd)					return Boolean.TRUE;				// check if remainder of pattern is anyString's				// if escChar == anyString, we couldn't be here				// If there is an escape in the pattern we break				boolean allPercentChars = true;				for (int i=pLoc+1;i<pEnd;i++)				{					if (! matchSpecial(pat, i, pEnd, anyStringInts))					{						allPercentChars=false;						break;					}				}				if (allPercentChars)					return Boolean.TRUE;				// pattern can match 0 or more chars in value.				// to test that, we take the remainder of pattern and				// apply it to ever-shorter  remainders of value until				// we hit a match.				// the loop never continues from this point -- we will				// always generate an answer here.				// REMIND: there are smarter ways to pick the remainders				// and do this matching.				// num chars left in value includes current char				int vRem = vEnd - vLoc;				int n=0;				// num chars left in pattern excludes the anyString				int minLen = getMinLen(pat, pLoc+1, pEnd, haveEsc, escCharInts, anyStringInts);				for (int i=vRem; i>=minLen; i--) 				{					Boolean restResult = Like.like(val,vLoc+n,vLoc+n+i,pat,pLoc+1,pEnd,escape,escapeLength, collator);					if (SanityManager.DEBUG)					{						if (restResult == null)						{							SanityManager.THROWASSERT("null result on like(vLoc+n = "+(vLoc+n)+", i = "+i+													  ", pLoc+1 = " + (pLoc+1) + ", pEnd-(pLoc+1) = " + 													  (pEnd-(pLoc+1)) + ")");						}					}					if (restResult.booleanValue())						return restResult;					n++;				}				// none of the possibilities worked 				return Boolean.FALSE;			}		}	}	/**		Calculate the shortest length string that could match this pattern for non-national chars	 */	static int getMinLen(char[] pattern, int pStart, int pEnd, boolean haveEsc, char escChar) 	{		int m=0;		for (int l = pStart; l<pEnd; ) 		{			if (haveEsc && pattern[l] == escChar) { // need one char				l+=2;				m++;			}			else if (pattern[l] == anyString) {				l++; // anyString, nothing needed			}			else { // anyChar or other chars, need one char				l++; m++;			}		}		return m;	}	/**		Calculate the shortest length string that could match this pattern for national chars	 */	static int getMinLen(int[] pattern, int pStart, int pEnd, boolean haveEsc, 						 int[] escCharInts, int[] anyStringInts) 	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线播放网站| 欧美性大战久久久久久久| 亚洲一区二区中文在线| 国产自产视频一区二区三区| 一本在线高清不卡dvd| 精品国产91九色蝌蚪| 亚洲gay无套男同| 色综合天天综合色综合av| 精品国产乱码久久久久久老虎 | 国产日产欧美一区二区视频| 亚洲成a人片综合在线| 亚洲免费观看高清完整版在线观看熊| 久草中文综合在线| 欧美日本在线播放| 亚洲精品菠萝久久久久久久| 国产电影一区在线| 2017欧美狠狠色| 开心九九激情九九欧美日韩精美视频电影| 99久久精品费精品国产一区二区| 欧美精品一区二区久久婷婷 | 日韩精品一区二区在线观看| 91麻豆精品91久久久久久清纯 | 91黄色免费观看| 国产精品乱码妇女bbbb| 国产精品99久久久久久久女警| 欧美不卡视频一区| 蜜桃视频在线观看一区二区| 91精品午夜视频| 日韩经典一区二区| 日韩免费观看高清完整版| 视频一区国产视频| 91精品国产色综合久久| 日韩不卡免费视频| 蜜臀av国产精品久久久久| 欧美一级午夜免费电影| 欧美aaa在线| 日韩欧美在线观看一区二区三区| 日日摸夜夜添夜夜添国产精品| 欧美伦理电影网| 日本不卡一二三区黄网| 日韩激情一二三区| 亚洲午夜视频在线观看| 麻豆视频观看网址久久| 欧美一级欧美一级在线播放| 国产视频视频一区| 成人性生交大片| 国产精品卡一卡二| 欧美三级三级三级| 久久精品国产一区二区| 久久婷婷色综合| 99久久精品国产网站| 亚洲韩国一区二区三区| 日韩视频免费观看高清完整版| 韩国中文字幕2020精品| 国产午夜精品理论片a级大结局| 国产精品伊人色| 亚洲欧美成人一区二区三区| 久久国产婷婷国产香蕉| 国产精品久久久久久久久搜平片| 99久久夜色精品国产网站| 午夜婷婷国产麻豆精品| 精品成a人在线观看| 99精品视频在线播放观看| 日韩综合在线视频| 国产精品视频免费| 欧美精品一卡两卡| 成人激情免费视频| 午夜电影一区二区三区| 国产喂奶挤奶一区二区三区| 在线精品视频免费观看| 韩国精品一区二区| 亚洲国产美国国产综合一区二区| 麻豆精品久久精品色综合| 中文字幕日韩av资源站| 91精品免费在线| 色综合久久综合网欧美综合网 | 一区二区三区.www| 精品免费99久久| 在线国产亚洲欧美| 国产精品中文字幕一区二区三区| 亚洲人成影院在线观看| 2020国产精品久久精品美国| 欧美日韩国产小视频| 成人午夜激情视频| 国产一区二区主播在线| 日本成人中文字幕在线视频| 欧美日韩在线精品一区二区三区激情| 久久成人免费电影| 香蕉影视欧美成人| 中文字幕一区二区三区色视频| 在线电影国产精品| 日本乱人伦一区| 成人激情电影免费在线观看| 激情另类小说区图片区视频区| 亚洲不卡一区二区三区| 亚洲欧洲三级电影| 免费久久精品视频| 精品国产露脸精彩对白| 麻豆精品在线视频| 久久青草国产手机看片福利盒子 | 免费美女久久99| 色一情一伦一子一伦一区| 欧美大胆一级视频| 91成人在线观看喷潮| 激情综合网av| 一区二区三区在线观看网站| 欧美国产激情二区三区| www国产精品av| 日韩午夜三级在线| 欧美日韩精品三区| 欧美男生操女生| 欧美肥妇毛茸茸| 欧美美女一区二区三区| 欧美日韩国产精品成人| 欧美日韩视频不卡| 欧美在线观看一区| 欧美日韩精品二区第二页| 在线日韩一区二区| 欧美大片拔萝卜| www.欧美色图| 国产一区二区日韩精品| 婷婷成人激情在线网| 久久蜜桃香蕉精品一区二区三区| 欧美午夜在线一二页| 亚洲第一av色| 精品国产一区二区三区四区四| 亚洲最新视频在线播放| 91在线精品秘密一区二区| 欧美色综合影院| 欧美男人的天堂一二区| 欧美一区二区视频在线观看2022| 亚洲欧洲国产专区| 国产成a人无v码亚洲福利| av成人免费在线| 国产福利电影一区二区三区| 国产成人午夜精品5599| 91香蕉视频mp4| 青青草97国产精品免费观看 | 欧美日韩免费在线视频| 日本不卡不码高清免费观看| 中文字幕第一区综合| 中文字幕一区二区三区在线观看| 26uuu国产日韩综合| 国产亚洲欧美日韩在线一区| 日韩电影在线观看电影| 99精品国产视频| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 亚洲人成网站在线| 热久久免费视频| 欧美久久免费观看| 日韩精品一区二区三区四区| 制服丝袜日韩国产| 国产精品九色蝌蚪自拍| 亚洲国产日韩在线一区模特| 樱花影视一区二区| 韩国理伦片一区二区三区在线播放| 色综合久久中文字幕综合网| 91精选在线观看| 亚洲视频在线观看一区| 免费在线看成人av| 在线观看网站黄不卡| 69精品人人人人| 国产精品私人自拍| 日韩成人一区二区三区在线观看| 成人精品一区二区三区四区| 欧美午夜精品理论片a级按摩| 精品国产99国产精品| 一色屋精品亚洲香蕉网站| av一区二区不卡| 精品视频免费在线| 中文字幕一区二区三区不卡在线 | 亚洲精品高清在线观看| 亚洲免费观看在线观看| 在线观看91精品国产麻豆| 免费在线看一区| 国产精品三级视频| 美国十次综合导航| 日韩区在线观看| 久久精品国产99国产| 丁香天五香天堂综合| 99久久久无码国产精品| 日韩一区中文字幕| 666欧美在线视频| 欧美亚洲日本国产| 国产成人亚洲精品狼色在线| 成人avav影音| 久久久久久毛片| 久久精品99久久久| 4hu四虎永久在线影院成人| 亚洲欧美日韩综合aⅴ视频| 国产91丝袜在线18| 国产毛片精品视频| 欧美成人a视频| 久久电影国产免费久久电影 | 国产成人精品网址| 日韩美一区二区三区| 免费精品视频在线| 精品sm在线观看| 国产福利一区二区三区视频| 欧美精品一区二区三区高清aⅴ |