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

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

?? utils.java

?? 這是一個入門級別的手機視頻軟件
?? JAVA
字號:
/* * @(#)Utils.java	1.5 04/03/10 * * Copyright (c) 2000-2004 Sun Microsystems, Inc. All rights reserved. * PROPRIETARY/CONFIDENTIAL * Use is subject to license terms */package example.mmademo;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.media.*;import javax.microedition.media.control.*;import java.util.*;import java.io.*;/** * Utility functions and listener interfaces * * @version 1.5 */public class Utils {    public static boolean DEBUG = false;    private Utils() {	//prevent accidental instanciation    }    public static void debugOut(String s) {	if (DEBUG) System.out.println(s);    }    public static void debugOut(Throwable t) {	if (DEBUG) System.out.println(t.toString());	if (DEBUG) t.printStackTrace();    }    public static void error(Throwable t, BreadCrumbTrail bct) {	if (DEBUG) t.printStackTrace();	error(friendlyException(t), bct);    }    public static void error(String s, BreadCrumbTrail bct) {	Alert alert = new Alert("Error", s, null, AlertType.ERROR);	alert.setTimeout(Alert.FOREVER);	bct.replaceCurrent(alert);    }    public static void FYI(String s, BreadCrumbTrail bct) {	Alert alert = new Alert("FYI", s, null, AlertType.INFO);	alert.setTimeout(Alert.FOREVER);	bct.replaceCurrent(alert);    }    /**     * "javax.microedition.rms.RecordStoreException: Bla"     * ->     * "RecordStoreException: Bla"     */    public static String friendlyException(Throwable t) {	if (t instanceof MediaException && t.getMessage().indexOf(" ")>5) {	    return t.getMessage();	}	String s = t.toString();	while (true) {	    int dot = s.indexOf(".");	    int space = s.indexOf(" "); if (space<0) space = s.length();	    int colon = s.indexOf(":"); if (colon<0) colon = s.length();	    if (dot >= 0 && dot < space && dot < colon) {		s = s.substring(dot+1);	    } else {		break;	    }	}	return s;    }    /**     * Prompts the user to enter a string.<p>     * <b>Caution</b>: this must be called in     * a different Thread than the lcdui event dispatcher. Unfortunately !     *     * @param title - title of the query window     * @param def - a default value that appears in the input field     * @param maxSize - max number of characters     * @return the entered text, or <code>null</code> if the user cancelled     */    public static void query(String title, String def, int maxSize,			     QueryListener listener, BreadCrumbTrail bct) {	query(title, def, maxSize, TextField.ANY, listener, bct);    }    /**     * Prompts the user to enter a string. <p>     * When the user finished entering the text,     * the <code>listener</code>'s methods are called.     * If the user pressed the OK button, the     * <code>listener</code>'s <code>queryOK</code> method     * is called with the entered text as parameter.     *     * The <code>listener</code> need not care about hiding the displayable.     *     * @param title - title of the query window     * @param def - a default value that appears in the input field     * @param maxSize - max number of characters     * @param constraints - see javax.microedition.lcdui.TextBox     * @param listener - the QueryListener which receives the events     */    public static void query(String title, String def, int maxSize, int constraints,			     QueryListener listener, BreadCrumbTrail bct) {	TextBox tb = new TextBox(title, def, maxSize, constraints);	tb.addCommand(QueryTask.cancelCommand);	tb.addCommand(QueryTask.OKCommand);	QueryTask qt = new QueryTask(listener, bct);	tb.setCommandListener(qt);	bct.go(tb);    }    /**     * splits the URL in the parts     * E.g: http://www.12fb.com:80/Media/MIDI/fb.mid#1     *     * 0: protocol (e.g. http)     * 1: host (e.g. www.12fb.com)     * 2: port (e.g. 80)     * 3: path (e.g. /Media/MIDI)     * 4: file (e.g. fb.mid)     * 5: anchor (e.g. 1)     *     * LIMITATION: URL must end with a slash if it is a directory     */    public static String[] splitURL(String url) throws Exception {	StringBuffer u=new StringBuffer(url);	String[] result=new String[6];	for (int i=0; i<=5; i++) {	    result[i]="";	}	// get protocol	boolean protFound=false;	int index=url.indexOf(":");	if (index>0) {	    result[0]=url.substring(0, index);	    u.delete(0, index+1);	    protFound=true;	}	else if (index==0) {	    throw new Exception("url format error - protocol");	}	// check for host/port	if (u.length()>2 && u.charAt(0)=='/' && u.charAt(1)=='/') {	    // found domain part	    u.delete(0, 2);	    int slash=u.toString().indexOf('/');	    if (slash<0) {		slash=u.length();	    }	    int colon=u.toString().indexOf(':');	    int endIndex=slash;	    if (colon>=0) {		if (colon>slash) {		    throw new Exception("url format error - port");		}		endIndex=colon;		result[2]=u.toString().substring(colon+1, slash);	    }	    result[1]=u.toString().substring(0, endIndex);	    u.delete(0, slash);	}	// get filename	if (u.length()>0) {	    url=u.toString();	    int slash=url.lastIndexOf('/');	    if (slash>0) {		result[3]=url.substring(0, slash);	    }	    if (slash<url.length()-1) {		String fn = url.substring(slash+1, url.length());		int anchorIndex = fn.indexOf("#");		if (anchorIndex>=0) {		    result[4] = fn.substring(0, anchorIndex);		    result[5] = fn.substring(anchorIndex+1);		} else {		    result[4] = fn;		}	    }	}	return result;    }    public static String mergeURL(String[] url) {	return ((url[0]=="")?"":url[0]+":/")	    +((url[1]=="")?"":"/"+url[1])	    +((url[2]=="")?"":":"+url[2])	    +url[3]+"/"+url[4]	    +((url[5]=="")?"":"#"+url[5]);    }    public static String guessContentType(String url) throws Exception {	// guess content type	String[] sURL = splitURL(url);	String ext = "";	String ct = "";	int lastDot = sURL[4].lastIndexOf('.');	if (lastDot>=0) {	    ext = sURL[4].substring(lastDot+1).toLowerCase();	}	if (ext.equals("mpg") || url.equals("avi")) {	    ct = "video/mpeg";	} else if (ext.equals("mid") || ext.equals("kar")) {	    ct = "audio/midi";	} else if (ext.equals("wav")) {	    ct = "audio/x-wav";	} else if (ext.equals("jts")) {	    ct = "audio/x-tone-seq";	} else if (ext.equals("txt")) {	    ct = "audio/x-txt";	} else if (ext.equals("amr")) {	    ct = "audio/amr";	} else if (ext.equals("awb")) {	    ct = "audio/amr-wb";	} else if (ext.equals("gif")) {	    ct = "image/gif";	}	return ct;    }    /**     * From SortDemo - modified to take Strings     *     * This is a generic version of C.A.R Hoare's Quick Sort     * algorithm.  This will handle arrays that are already     * sorted, and arrays with duplicate keys.<BR>     *     * If you think of a one dimensional array as going from     * the lowest index on the left to the highest index on the right     * then the parameters to this function are lowest index or     * left and highest index or right.  The first time you call     * this function it will be with the parameters 0, a.length - 1.     *     * @param s       a String array     * @param lo0     left boundary of array partition     * @param hi0     right boundary of array partition     */    private static void quickSort(String[] s, int lo0, int hi0) {	int lo = lo0;	int hi = hi0;	String mid;	if (hi0 > lo0) {	    /* Arbitrarily establishing partition element as the midpoint of	     * the array.	     */	    mid = s[(lo0 + hi0) / 2 ].toUpperCase();	    // loop through the array until indices cross	    while(lo <= hi) {		/* find the first element that is greater than or equal to		 * the partition element starting from the left Index.		 */		while((lo < hi0) && (s[lo].toUpperCase().compareTo(mid) < 0)) {		    ++lo;		}		/* find an element that is smaller than or equal to		 * the partition element starting from the right Index.		 */		while((hi > lo0) && (s[hi].toUpperCase().compareTo(mid) > 0)) {		    --hi;		}		// if the indexes have not crossed, swap		if(lo <= hi) {		    String temp;		    temp = s[lo];		    s[lo] = s[hi];		    s[hi] = temp;		    ++lo;		    --hi;		}	    }	    /* If the right index has not reached the left side of array	     * must now sort the left partition.	     */	    if (lo0 < hi) {		quickSort(s, lo0, hi);	    }	    /* If the left index has not reached the right side of array	     * must now sort the right partition.	     */	    if (lo < hi0) {		quickSort(s, lo, hi0);	    }	}    }    public static void sort(String[] elements) {	quickSort(elements, 0, elements.length - 1);    }    /**     * A class to handle the query     */    private static class QueryTask implements CommandListener, Runnable {	private static Command cancelCommand = new Command("Cancel", Command.CANCEL, 1);	private static Command OKCommand = new Command("OK", Command.OK, 1);	// "parameters" passed to commandAction method	private QueryListener queryListener;	private BreadCrumbTrail queryBCT;	private static String queryText = "";        private QueryTask(QueryListener listener, BreadCrumbTrail bct) {	    this.queryListener = listener;	    this.queryBCT = bct;	}    /**     * Respond to commands     */    public void commandAction(Command c, Displayable s) {	if (queryBCT != null) {	    Utils.debugOut("Utils.commandAction: goBack()");	    queryBCT.goBack();	}	if (c == cancelCommand) {	    Utils.debugOut("Command: cancel");	    if (queryListener!=null) {		queryListener.queryCancelled();	    }	}	else if (c == OKCommand) {	    Utils.debugOut("Command: OK");	    if (queryListener!=null) {		queryText = "";		if (s instanceof TextBox) {		    queryText = ((TextBox) s).getString();		}		// for some reasons, MIDP may have a deadlock		// if some lengthy operation (i.e. http i/o)		// is initiated from the command listener		// thread. Therefore, issue the event		// from another thread...		(new Thread(this)).start();	    }	}    }    /**     * Runnable implementation -- sends     * the event to the listener.     * It is executed in a separate thread     * to not block the VM's command dispatch     * thread.     */    public void run() {	sendListenerEvent();    }    /**     * Send the text to the query listener     */    private void sendListenerEvent() {	if (queryListener != null) {	    queryListener.queryOK(queryText);	}    }}    /**     * Interface to be implemented by classes     * that provide <i>Back</i> functionality.     */    interface BreadCrumbTrail {	public Displayable go(Displayable d);	public Displayable goBack();	public void handle(String name, String url);	public Displayable replaceCurrent(Displayable d);	public Displayable getCurrentDisplayable();    }    /**     * Interface implemented by classes that     * can handle (playback, display, etc.) url's.     */    interface ContentHandler {	public void close();	public boolean canHandle(String url);	public void handle(String name, String url);    }    /**     * Interface that is implemented by classes     * that use the query() functions.     */    interface QueryListener {	public void queryOK(String text);	public void queryCancelled();    }    /**     * Interface implemented by Displayable's that     * want to respond to the MIDlet's startApp()     * and pauseApp() calls.     */    interface Interruptable {	/**	 * Called in response to a request to pause the MIDlet.	 */	public void pauseApp();		/**	 * Called when a MIDlet is asked to resume operations	 * after a call to pauseApp(). This method is only	 * called after pauseApp(), so it is different from	 * MIDlet's startApp().	 */	public void resumeApp();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区欧美一区| 成人免费观看av| 一区二区欧美在线观看| 国产日产欧美一区| 中文字幕av一区二区三区免费看| 精品99久久久久久| 国产亚洲一区二区三区四区 | 天天操天天色综合| 亚洲第一精品在线| 美女视频黄久久| 国产剧情一区在线| 成人的网站免费观看| 色婷婷精品久久二区二区蜜臂av| 色婷婷av一区| 717成人午夜免费福利电影| 日韩精品专区在线影院重磅| 精品福利一二区| 国产精品妹子av| 亚洲国产成人tv| 国产一区二区在线视频| 国产99久久久久| 欧美视频精品在线观看| 精品奇米国产一区二区三区| 欧美激情一区在线观看| 尤物av一区二区| 激情综合色综合久久综合| 成人看片黄a免费看在线| 91福利精品第一导航| 精品福利一区二区三区免费视频| 国产精品网站一区| 亚洲国产另类av| 高清不卡一区二区在线| 欧美日韩一区二区在线观看| 久久人人爽人人爽| 午夜私人影院久久久久| 国产精品一区免费视频| 色丁香久综合在线久综合在线观看 | 天天操天天干天天综合网| 国模娜娜一区二区三区| 色系网站成人免费| 欧美精品一区二| 亚洲一区二区影院| 大尺度一区二区| 日韩三级精品电影久久久 | 欧美成人免费网站| 亚洲美女电影在线| 国产精品一级二级三级| 欧美写真视频网站| 国产精品毛片久久久久久| 日本aⅴ免费视频一区二区三区| 成人晚上爱看视频| 精品国产1区二区| 午夜欧美视频在线观看| 91原创在线视频| 国产亚洲成年网址在线观看| 日韩av在线发布| 欧美日韩国产a| 国产精品欧美综合在线| 激情综合网天天干| 日韩欧美中文一区二区| 亚洲成av人片一区二区| 色综合久久综合中文综合网| 中文字幕欧美激情| 国产不卡视频一区| 久久精品水蜜桃av综合天堂| 黄页视频在线91| 精品久久99ma| 男女男精品网站| 日韩免费观看高清完整版在线观看| 亚洲自拍偷拍九九九| 色狠狠一区二区三区香蕉| 日韩码欧中文字| 色婷婷国产精品| 一个色妞综合视频在线观看| 91国产成人在线| 一区二区三区四区在线免费观看| 色欧美日韩亚洲| 亚洲黄色小视频| 精品视频一区二区三区免费| 艳妇臀荡乳欲伦亚洲一区| 日本丰满少妇一区二区三区| 亚洲精选视频免费看| 色94色欧美sute亚洲13| 一二三四社区欧美黄| 精品视频在线免费观看| 人妖欧美一区二区| 久久精品人人做人人爽97| 成人午夜看片网址| 亚洲欧美激情视频在线观看一区二区三区| 99免费精品在线观看| 亚洲精品欧美在线| 91麻豆精品久久久久蜜臀| 丝袜a∨在线一区二区三区不卡| 91精品中文字幕一区二区三区| 天堂在线一区二区| 久久久不卡网国产精品二区| 成人av电影在线网| 亚洲成人动漫在线免费观看| 日韩精品一区二区三区视频播放 | 日本韩国欧美在线| 日韩精品三区四区| 久久先锋影音av| 91香蕉视频mp4| 三级精品在线观看| 欧美高清在线精品一区| 欧洲在线/亚洲| 久久99精品久久久久久动态图| 中文字幕av免费专区久久| 日本高清无吗v一区| 久久精品国产成人一区二区三区| 国产精品欧美久久久久无广告| 欧美专区日韩专区| 国产一区视频导航| 亚洲线精品一区二区三区| 久久在线免费观看| 欧美视频日韩视频在线观看| 紧缚捆绑精品一区二区| 亚洲制服丝袜在线| 国产欧美久久久精品影院| 欧美人狂配大交3d怪物一区| 成人精品免费看| 久久99久久精品| 亚洲国产精品一区二区www在线| 国产人久久人人人人爽| 欧美久久一二三四区| 91丝袜高跟美女视频| 国产精品一卡二卡在线观看| 日本女人一区二区三区| 亚洲精品欧美专区| 国产精品久久久久一区| 久久久综合九色合综国产精品| 欧美日韩一区二区在线观看| 99久久99精品久久久久久| 国产一区二区精品在线观看| 日本午夜一本久久久综合| 一区二区三区四区不卡视频| 国产精品久久久久久久蜜臀| 久久九九影视网| 精品剧情v国产在线观看在线| 欧美区在线观看| 欧美视频一区二区在线观看| 一本大道av伊人久久综合| 不卡av在线免费观看| 国产69精品久久久久毛片| 国产另类ts人妖一区二区| 麻豆高清免费国产一区| 人人精品人人爱| 美女网站在线免费欧美精品| 日日摸夜夜添夜夜添精品视频| 亚洲成人一区在线| 丝袜诱惑亚洲看片 | 久久久噜噜噜久噜久久综合| 欧美mv日韩mv| 久久综合九色欧美综合狠狠| 日韩精品中文字幕一区二区三区 | 亚洲精品久久久蜜桃| 亚洲图片另类小说| 伊人一区二区三区| 亚洲自拍偷拍av| 日韩精品乱码av一区二区| 日韩精品亚洲专区| 久久超碰97中文字幕| 国产精品亚洲午夜一区二区三区| 精品无人码麻豆乱码1区2区| 国产在线视频一区二区三区| 国产激情视频一区二区三区欧美| 国产麻豆欧美日韩一区| 粉嫩13p一区二区三区| 91一区一区三区| 欧美日韩免费电影| 欧美成人一区二区三区| 国产婷婷色一区二区三区在线| 久久久久久电影| 中文字幕一区免费在线观看| 一区二区三区四区国产精品| 天天影视涩香欲综合网| 国产一区二区成人久久免费影院 | 久久99精品国产.久久久久久 | 日韩一级二级三级精品视频| 精品国产sm最大网站| 成人欧美一区二区三区| 天天av天天翘天天综合网色鬼国产| 久久se精品一区二区| 成人午夜视频在线观看| 欧美三级日本三级少妇99| 精品国产三级电影在线观看| 国产精品美女视频| 亚洲6080在线| 成人免费av在线| 欧美一区二区三区免费在线看| 国产日产欧产精品推荐色| 亚洲成人一二三| 粉嫩aⅴ一区二区三区四区| 精品视频在线看| 国产精品视频第一区| 蜜臀av一区二区在线观看| jlzzjlzz亚洲女人18| 日韩欧美中文字幕精品| 一区二区三区在线观看欧美| 国产精品亚洲视频|