Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java ÕýÔò±í´ïʽ¹¤¾ßÀà

//ʹÓÃabstractÄ¿µÄÊÇΪÁËÈÃʹÓÃÕßÖ»Äܵ÷ÓÃgetInstance»ñȡʵÀý
public abstract class RegexUtil {
public static void main(String[] args) {
RegexUtil ru = RegexUtil.getInstance();
String regexp = "(\\d+.\\d+.\\d+.\\d+):(\\d+)";
String data = "ldap://192.168.16.152:389/";
System.out.println(">>>" + ru.matchGroup(regexp, data).size());
}
public List<String> matchGroup(String regexp, String data) {
Pattern p = Pattern.compile(regexp);
Matcher matcher = p.matcher(data);
List<String> list = null;
while (matcher.find()) {
int length = matcher.groupCount();
list = new java.util.ArrayList<String>(length);
for (int i = 1; i < length + 1; i++) {
list.add(matcher.group(i));
}
}
return list;
}
private static RegexUtil ru = null;
//µ¥Ì«Ä£Ê½
public static RegexUtil getInstance() {
if (ru == null) {
ru = new RegexUtil() {
};
}
return ru;
}
}


Ïà¹ØÎĵµ£º

JavaÖм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

java webservice

Web Service¸ÅÊö
ʲôÊÇWeb Service
       Web ServiceÊÇÄܹ»»ùÓÚÍøÂ磬ÓÈÆäÊÇ»ùÓÚÍòάÍø£¨World Wide
Web£©Ö±½Óµ÷ÓõÄÄܹ»´¦ÀíÀëÉ¢ÈÎÎñ»òÁ¬ÐøÈÎÎñµÄÈí¼þÄ£ÐÍ¡£Ä¿Ç°½ÏΪÁ÷ÐеÄÓ¦ÓÃÊÇ£¬ÓÉÒ»¼Ò¹«Ë¾¶ÔÆäרÓÐÊý¾Ý½øÐзâ×°£¬ÌṩWeb
Service£¬È»ºóÆäËü¹«Ë¾¾Í¿ÉÒÔͨ¹ýInternetÀ´¶¯Ì¬Ê¹ÓÃÕâÐ ......

Java½â»ó3 35Ò»·ÖÖÓÓÖÒ»·ÖÖÓ

ÏÂÃæµÄ³ÌÐòÔÚÄ£·ÂÒ»¸ö¼òµ¥µÄʱÖÓ¡£ËüµÄÑ­»·±äÁ¿±íʾһ¸öºÁÃë¼ÆÊýÆ÷£¬Æä¼ÆÊýÖµ´Ó0¿ªÊ¼Ö±ÖÁһСʱÖаüº¬µÄºÁÃëÊý¡£Ñ­»·ÌåÒÔ¶¨ÆÚµÄʱ¼ä¼ä¸ô¶ÔÒ»¸ö·ÖÖÓ¼ÆÊýÆ÷Ö´ÐÐÔöÁ¿²Ù×÷¡£×îºó£¬¸Ã³ÌÐò½«´òÓ¡·ÖÖÓ¼ÆÊýÆ÷¡£ÄÇôËü»á´òÓ¡³öʲôÄØ£¿
public class Clock {
public static void main(String[] args) {
int minutes ......

Java½â»ó4 41ÓòºÍÁ÷

ÏÂÃæµÄ·½·¨½«Ò»¸öÎļþ¿½±´µ½ÁíÒ»¸öÎļþ£¬²¢ÇÒ±»Éè¼ÆΪҪ¹Ø±ÕËüËù´´½¨µÄÿһ¸öÁ÷£¬¼´Ê¹ËüÅöµ½I/O´íÎóÒ²ÒªÈç´Ë¡£Òź¶µÄÊÇ£¬Ëü²¢·Ç×ÜÊÇÄܹ»×öµ½ÕâÒ»µã¡£ÎªÊ²Ã´²»ÄÜÄØ£¬ÄãÈçºÎ²ÅÄܶ©ÕýËüÄØ£¿
static void copy(String src, String dest) throws IOException {
InputStream in = null;
OutputStream out = n ......

JavaÃæÏò¶ÔÏó±à³Ì˼Ïë µÚÒ»ÕÂ

µÚÒ»Õ              ¸ÅÊö
°æȨÉùÃ÷
´ËÎĵµÓɱ¾È˸ºÔðÕûÀí×ܽᣬ²¢¶Ô¸ÃÎĵµ±£ÓÐÓÐÏÞÔðÈÎȨÀû£¬´ËÎĵµÖ»ÄÜÓÃÓÚѧϰÒÔ¼°½Ìѧ£¬ÇëÎðÓÃ×÷ÉÌÒµÓÃ;£¬Òò´Ë¶ø
²úÉúµÄ·¨ÂÉÎÊÌ⣬±¾ÈËÒ»¸Å²»¸ºÔð¡£ ±¾ÈËÉùÃ÷£¬´ËÎĵµ×ÊÁÏΪ±¾È˽Ìѧ¾­ÑéºÍÍøÂç×ÊÁÏÊÕ¼¯ºÏ²¢Ö®³É¹û ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ