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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sortitem.java

?? 幾個(gè)java的程序
?? JAVA
字號(hào):
import java.awt.*;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import java.io.InputStream;import java.util.Hashtable;import java.net.*;/** * A simple applet class to demonstrate a sort algorithm.該小應(yīng)用程序揭示一種排序算法 * You can specify a sorting algorithm using the "alg"讀者可以使用參數(shù)來(lái)確定使用的算法 * attribyte. When you click on the applet, a thread is當(dāng)用鼠標(biāo)單擊該小應(yīng)用程序時(shí),屏幕上將使用動(dòng)畫來(lái)顯示算法的執(zhí)行過(guò)程 * forked which animates the sorting algorithm. */public class SortItem extends java.applet.Applet implements Runnable {    /**     * The thread that is sorting (or null).排序線程     */    private Thread kicker;    /**     * The array that is being sorted.被排序的數(shù)組     */    int arr[];    /**     * The high water mark.高水位標(biāo)記     */    int h1 = -1;    /**     * The low water mark.低水位標(biāo)記     */    int h2 = -1;    /**     * The name of the algorithm.排序算法的名稱     */    String algName;    /**     * The sorting algorithm (or null).排序算法     */    SortAlgorithm algorithm;    /**     * Fill the array with random numbers from 0...使用從0到n-1的隨機(jī)數(shù)填滿數(shù)組     */    void scramble() {	int a[] = new int[getSize().height / 2];	double f = getSize().width / (double) a.length;	for (int i = a.length; --i >= 0;) {	    a[i] = (int)(i * f);	}	for (int i = a.length; --i >= 0;) {	    int j = (int)(i * Math.random());	    int t = a[i];	    a[i] = a[j];	    a[j] = t;	}	arr = a;    }    /**     * Pause a while.暫停,見(jiàn)SortAlgorithm程序      */    void pause() {	pause(-1, -1);    }    /**     * Pause a while, and draw the high water mark.暫停,并且標(biāo)出高水位     * 見(jiàn)SortAlgorithm程序     */    void pause(int H1) {	pause(H1, -1);    }    /**     * Pause a while, and draw the low&high water marks.暫停,并且標(biāo)出高水位&低水位     * @see 見(jiàn)SortAlgorithm程序     */    void pause(int H1, int H2) {	h1 = H1;	h2 = H2;	if (kicker != null) {	    repaint();	}	try {Thread.sleep(20);} catch (InterruptedException e){}    }    /**     * Initialize the applet.初始化小應(yīng)用程序     */    public void init() {	String at = getParameter("alg");	if (at == null) {	    at = "BubbleSort";	}	algName = at + "Algorithm";	scramble();	addMouseListener(new ClockStarter());	resize(100, 100);    }    /**     * Paint the array of numbers as a list將數(shù)組中的不同數(shù)字用長(zhǎng)度不同的水平線段來(lái)表示出來(lái)     * of horizontal lines of varying lenghts.     */    public void paint(Graphics g) {	int a[] = arr;	int y = getSize().height - 1;	// Erase old lines 消除舊的線段	g.setColor(getBackground());	for (int i = a.length; --i >= 0; y -= 2) {	    g.drawLine(arr[i], y, getSize().width, y);	}	// Draw new lines畫新線段	g.setColor(Color.black);	y = getSize().height - 1;	for (int i = a.length; --i >= 0; y -= 2) {	    g.drawLine(0, y, arr[i], y);	}	if (h1 >= 0) {	    g.setColor(Color.red);	    y = h1 * 2 + 1;	    g.drawLine(0, y, getSize().width, y);	}	if (h2 >= 0) {	    g.setColor(Color.blue);	    y = h2 * 2 + 1;	    g.drawLine(0, y, getSize().width, y);	}    }    /**     * Update without erasing the background.采用不消除背景的技術(shù)進(jìn)行更新     */    public void update(Graphics g) {	paint(g);    }    /**     * Run the sorting algorithm. This method is     * called by class Thread once the sorting algorithm     * is started.執(zhí)行排序算法,排序算法一旦開(kāi)始就啟動(dòng)該方法     * @see java.lang.Thread#run     * @see SortItem#mouseUp     */    public void run() {	try {	    if (algorithm == null) {		algorithm = (SortAlgorithm)Class.forName(algName).newInstance();		algorithm.setParent(this);	    }	    algorithm.init();	    algorithm.sort(arr);	} catch(Exception e) {	}    }    /**     * Stop the applet. Kill any sorting algorithm that     * is still sorting.停止小應(yīng)用程序,殺死一切正在進(jìn)行的排序算法     */    public synchronized void stop() {	if (kicker != null) {            try {		kicker.stop();            } catch (IllegalThreadStateException e) {                // ignore this exception忽略這個(gè)異常            }	    kicker = null;	}	if (algorithm != null){            try {		algorithm.stop();            } catch (IllegalThreadStateException e) {                // ignore this exception忽略這個(gè)異常            }	}    }    /**     * For a Thread to actually do the sorting. This routine makes為了使一個(gè)線程真正實(shí)現(xiàn)排序,確認(rèn)當(dāng)用戶重復(fù)的在小應(yīng)用程序上單擊鼠標(biāo)時(shí),不同時(shí)啟動(dòng)多個(gè)線程     * sure we do not simultaneously start several sorts if the user     * repeatedly clicks on the sort item.  It needs to be它需要與方法同步     * synchronoized with the stop() method because they both     * manipulate the common kicker variable.     */    synchronized void startSort() {	if (kicker == null || !kicker.isAlive()) {	    scramble();	    repaint();	    kicker = new Thread(this);	    kicker.start();	}    }    /**     * Here's an inner class that implements all the event handling這里使用一個(gè)內(nèi)部類來(lái)真正實(shí)現(xiàn)該小應(yīng)用程序中所有的事件處理工作     * for this applet.  Wow, this simplifies the code!  I had to     * remove the "private" modifier from the startSort method so      * that this class could use startSort.為了使這個(gè)類能使用startSort方法,這里將私有屬性去掉     */    class ClockStarter extends MouseAdapter {        /**         * The user clicked in the applet. Start the clock!當(dāng)用戶單擊小應(yīng)用程序時(shí)將啟動(dòng)計(jì)時(shí)器         */	public void mouseReleased(MouseEvent e) {	    startSort();	}    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费看视频| 成人综合在线网站| 欧美性色aⅴ视频一区日韩精品| 精品视频1区2区| 国产清纯白嫩初高生在线观看91| 精品成人一区二区| 亚洲天天做日日做天天谢日日欢| 麻豆精品一区二区综合av| 欧美亚洲国产一区二区三区| 亚洲精品国产无套在线观| 丰满少妇久久久久久久| 日韩女优毛片在线| 婷婷六月综合亚洲| 欧洲精品视频在线观看| 亚洲色图欧美偷拍| 欧美最猛性xxxxx直播| 午夜精品一区二区三区电影天堂| 日韩欧美国产电影| 成人国产亚洲欧美成人综合网| 日韩欧美高清dvd碟片| 国产精品一级片| 久久蜜桃香蕉精品一区二区三区| 男人的j进女人的j一区| 欧美日韩一区高清| 国产一区二区视频在线| 精品国产精品网麻豆系列| 成人性生交大合| 日韩黄色在线观看| 777奇米四色成人影色区| 亚欧色一区w666天堂| 欧美写真视频网站| 激情五月婷婷综合| 国产日产欧美精品一区二区三区| 欧美在线免费观看视频| 精品一区二区三区久久| 欧美极品美女视频| 成人黄色电影在线| 日韩电影免费在线看| 日韩欧美国产综合| 色婷婷亚洲综合| 亚洲综合999| 8v天堂国产在线一区二区| 成人av网站大全| 蜜臀av性久久久久蜜臀av麻豆| 中文字幕欧美日韩一区| 91精品福利在线一区二区三区| 美女精品一区二区| 亚洲精品乱码久久久久久| 欧美精品一区二区在线观看| 日本乱码高清不卡字幕| 免费在线观看视频一区| 亚洲免费视频中文字幕| 欧美一区二区大片| 欧美日韩中文另类| 99久久精品久久久久久清纯| 亚洲成人av在线电影| 成人欧美一区二区三区| 欧美精品国产精品| 国产乱码精品一区二区三区忘忧草| 亚洲已满18点击进入久久| 国产精品久久久久毛片软件| 欧美视频在线观看一区| av电影在线观看一区| 午夜精品久久久久久久| 亚洲欧洲制服丝袜| 国产精品国产精品国产专区不片 | 亚洲18女电影在线观看| 亚洲婷婷国产精品电影人久久| 中文字幕欧美激情一区| 久久蜜桃av一区精品变态类天堂| 日韩美女视频在线| 日韩欧美激情四射| 精品电影一区二区三区| 亚洲精品在线一区二区| 日韩精品一区二区三区在线观看 | 亚洲国产精品高清| 久久亚洲精华国产精华液| 91视视频在线直接观看在线看网页在线看| 午夜精品福利在线| 亚洲成人免费视| 亚洲成人黄色影院| 日本系列欧美系列| 免费高清在线视频一区·| 日韩精品乱码免费| 蜜桃视频在线观看一区| 麻豆精品视频在线| 韩国午夜理伦三级不卡影院| 韩国精品免费视频| 国产高清久久久久| 亚洲国产一区在线观看| 国产精品伦一区| 精品动漫一区二区三区在线观看| 久久人人超碰精品| 欧美高清一级片在线观看| 国产精品白丝在线| 悠悠色在线精品| 日韩成人免费电影| 激情六月婷婷久久| 成人精品鲁一区一区二区| 92国产精品观看| 欧美老女人第四色| 久久精品视频一区二区三区| 91精品国产高清一区二区三区蜜臀| 欧美一区二区三区小说| 久久久电影一区二区三区| 最新成人av在线| 亚洲午夜激情网站| 国内欧美视频一区二区| 99久久精品久久久久久清纯| 欧美日韩亚洲综合一区二区三区| 日韩欧美第一区| 亚洲欧洲日本在线| 日本中文字幕不卡| 成人免费电影视频| 欧美久久久久久久久中文字幕| 精品久久国产字幕高潮| 欧美大度的电影原声| 国产精品免费视频一区| 五月婷婷久久丁香| 国产激情视频一区二区在线观看 | 久久美女艺术照精彩视频福利播放| 亚洲欧洲日韩在线| 久久精品99久久久| 久久精品国产99久久6| 97精品久久久午夜一区二区三区| 日韩欧美资源站| 久久久影视传媒| 亚洲成人综合视频| 成人av免费在线播放| 91精品国产乱码久久蜜臀| 亚洲欧美日韩国产中文在线| 久久99国产精品尤物| 欧美日韩视频一区二区| 国产清纯白嫩初高生在线观看91 | 亚洲影视在线播放| 成人综合婷婷国产精品久久蜜臀| 欧美日产在线观看| 精品少妇一区二区三区| 亚洲综合视频在线| 不卡av在线免费观看| 亚洲精品一区在线观看| 亚洲一区二区高清| 色综合久久久久久久| 国产清纯白嫩初高生在线观看91| 麻豆精品视频在线观看| 欧美日韩一级二级| 亚洲精品成人精品456| 福利电影一区二区三区| 久久影院视频免费| 另类小说一区二区三区| 51午夜精品国产| 亚洲午夜久久久久久久久电影网 | 国产精品一区在线| 日韩美女一区二区三区| 日本不卡1234视频| 制服丝袜av成人在线看| 一区二区三区不卡视频 | 亚洲电影在线播放| 91丨porny丨蝌蚪视频| 国产精品免费久久久久| 国产乱人伦偷精品视频不卡| 日韩精品资源二区在线| 日韩av电影免费观看高清完整版| 欧美日韩国产123区| 亚洲综合在线观看视频| 91久久精品一区二区二区| 亚洲男帅同性gay1069| 91网站最新地址| 亚洲欧洲成人精品av97| av一区二区久久| 亚洲视频网在线直播| 91在线观看下载| 一区二区三区视频在线看| 91麻豆蜜桃一区二区三区| 中文字幕一区在线观看视频| 99精品欧美一区| 亚洲一二三四区不卡| 欧美久久久久免费| 日本成人在线一区| 久久综合色一综合色88| 国产99精品在线观看| 国产精品久久久久影院| 91视频国产资源| 亚欧色一区w666天堂| 欧美成人精品福利| 国产成人精品影视| 亚洲日本一区二区| 欧美日韩国产免费一区二区| 日本不卡高清视频| 国产色一区二区| 99国产精品国产精品毛片| 亚洲成av人片在线| 久久免费偷拍视频| 91在线观看地址| 青青草91视频| 中文字幕高清不卡| 欧美日韩电影在线| 国产在线麻豆精品观看| 亚洲视频免费看| 日韩欧美成人一区二区|