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

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

?? timer.java

?? 有關j2me的很好的例子可以研究一下
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * @(#)Timer.java	1.20 01/08/21 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information").  You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. */package java.util;import java.util.Date;/** * A facility for threads to schedule tasks for future execution in a * background thread.  Tasks may be scheduled for one-time execution, or for * repeated execution at regular intervals. * * <p>Corresponding to each <tt>Timer</tt> object is a single background * thread that is used to execute all of the timer's tasks, sequentially. * Timer tasks should complete quickly.  If a timer task takes excessive time * to complete, it "hogs" the timer's task execution thread.  This can, in * turn, delay the execution of subsequent tasks, which may "bunch up" and * execute in rapid succession when (and if) the offending task finally * completes. * * <p>After the last live reference to a <tt>Timer</tt> object goes away * <i>and</i> all outstanding tasks have completed execution, the timer's task * execution thread terminates gracefully (and becomes subject to garbage * collection).  However, this can take arbitrarily long to occur.  By * default, the task execution thread does not run as a <i>daemon thread</i>, * so it is capable of keeping an application from terminating.  If a caller * wants to terminate a timer's task execution thread rapidly, the caller * should invoke the timer's <tt>cancel</tt> method. * * <p>If the timer's task execution thread terminates unexpectedly, for * example, because its <tt>stop</tt> method is invoked, any further * attempt to schedule a task on the timer will result in an * <tt>IllegalStateException</tt>, as if the timer's <tt>cancel</tt> * method had been invoked. * * <p>This class is thread-safe: multiple threads can share a single * <tt>Timer</tt> object without the need for external synchronization. * * <p>This class does <i>not</i> offer real-time guarantees: it schedules * tasks using the <tt>Object.wait(long)</tt> method. * <p> * Timers function only within a single VM and are cancelled when the VM exits. * When the VM is started no timers exist, they are created only by * application request. * * @see     TimerTask * @see     Object#wait(long) * @since   1.3 */public class Timer {    /**     * The timer task queue.  This data structure is shared with the timer     * thread.  The timer produces tasks, via its various schedule calls,     * and the timer thread consumes, executing timer tasks as appropriate,     * and removing them from the queue when they're obsolete.     */    private TaskQueue queue = new TaskQueue();    /**     * The timer thread.     */    private TimerThread thread = new TimerThread(queue);    /**     * Creates a new timer.  The associated thread does <i>not</i> run as     * a daemon thread, which may prevent an application from terminating.     *     * @see Thread     * @see #cancel()     */    public Timer() {        thread.start();    }    /**     * Schedules the specified task for execution after the specified delay.     *     * @param task  task to be scheduled.     * @param delay delay in milliseconds before task is to be executed.     * @throws IllegalArgumentException if <tt>delay</tt> is negative, or     *         <tt>delay + System.currentTimeMillis()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, or timer was cancelled.     */    public void schedule(TimerTask task, long delay) {        if (delay < 0)            throw new IllegalArgumentException("Negative delay.");        sched(task, System.currentTimeMillis()+delay, 0);    }    /**     * Schedules the specified task for execution at the specified time.  If     * the time is in the past, the task is scheduled for immediate execution.     *     * @param task task to be scheduled.     * @param time time at which task is to be executed.     * @throws IllegalArgumentException if <tt>time.getTime()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, timer was cancelled, or timer thread terminated.     */    public void schedule(TimerTask task, Date time) {        sched(task, time.getTime(), 0);    }    /**     * Schedules the specified task for repeated <i>fixed-delay execution</i>,     * beginning after the specified delay.  Subsequent executions take place     * at approximately regular intervals separated by the specified period.     *     * <p>In fixed-delay execution, each execution is scheduled relative to     * the actual execution time of the previous execution.  If an execution     * is delayed for any reason (such as garbage collection or other     * background activity), subsequent executions will be delayed as well.     * In the long run, the frequency of execution will generally be slightly     * lower than the reciprocal of the specified period (assuming the system     * clock underlying <tt>Object.wait(long)</tt> is accurate).     *     * <p>Fixed-delay execution is appropriate for recurring activities     * that require "smoothness."  In other words, it is appropriate for     * activities where it is more important to keep the frequency accurate     * in the short run than in the long run.  This includes most animation     * tasks, such as blinking a cursor at regular intervals.  It also includes     * tasks wherein regular activity is performed in response to human     * input, such as automatically repeating a character as long as a key     * is held down.     *     * @param task   task to be scheduled.     * @param delay  delay in milliseconds before task is to be executed.     * @param period time in milliseconds between successive task executions.     * @throws IllegalArgumentException if <tt>delay</tt> is negative, or     *         <tt>delay + System.currentTimeMillis()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, timer was cancelled, or timer thread terminated.     */    public void schedule(TimerTask task, long delay, long period) {        if (delay < 0)            throw new IllegalArgumentException("Negative delay.");        if (period <= 0)            throw new IllegalArgumentException("Non-positive period.");        sched(task, System.currentTimeMillis()+delay, -period);    }    /**     * Schedules the specified task for repeated <i>fixed-delay execution</i>,     * beginning at the specified time. Subsequent executions take place at     * approximately regular intervals, separated by the specified period.     *     * <p>In fixed-delay execution, each execution is scheduled relative to     * the actual execution time of the previous execution.  If an execution     * is delayed for any reason (such as garbage collection or other     * background activity), subsequent executions will be delayed as well.     * In the long run, the frequency of execution will generally be slightly     * lower than the reciprocal of the specified period (assuming the system     * clock underlying <tt>Object.wait(long)</tt> is accurate).     *     * <p>Fixed-delay execution is appropriate for recurring activities     * that require "smoothness."  In other words, it is appropriate for     * activities where it is more important to keep the frequency accurate     * in the short run than in the long run.  This includes most animation     * tasks, such as blinking a cursor at regular intervals.  It also includes     * tasks wherein regular activity is performed in response to human     * input, such as automatically repeating a character as long as a key     * is held down.     *     * @param task   task to be scheduled.     * @param firstTime First time at which task is to be executed.     * @param period time in milliseconds between successive task executions.     * @throws IllegalArgumentException if <tt>time.getTime()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, timer was cancelled, or timer thread terminated.     */    public void schedule(TimerTask task, Date firstTime, long period) {        if (period <= 0)            throw new IllegalArgumentException("Non-positive period.");        sched(task, firstTime.getTime(), -period);    }    /**     * Schedules the specified task for repeated <i>fixed-rate execution</i>,     * beginning after the specified delay.  Subsequent executions take place     * at approximately regular intervals, separated by the specified period.     *     * <p>In fixed-rate execution, each execution is scheduled relative to the     * scheduled execution time of the initial execution.  If an execution is     * delayed for any reason (such as garbage collection or other background     * activity), two or more executions will occur in rapid succession to     * "catch up."  In the long run, the frequency of execution will be     * exactly the reciprocal of the specified period (assuming the system     * clock underlying <tt>Object.wait(long)</tt> is accurate).     *     * <p>Fixed-rate execution is appropriate for recurring activities that     * are sensitive to <i>absolute</i> time, such as ringing a chime every     * hour on the hour, or running scheduled maintenance every day at a     * particular time.  It is also appropriate for for recurring activities     * where the total time to perform a fixed number of executions is     * important, such as a countdown timer that ticks once every second for     * ten seconds.  Finally, fixed-rate execution is appropriate for     * scheduling multiple repeating timer tasks that must remain synchronized     * with respect to one another.     *     * @param task   task to be scheduled.     * @param delay  delay in milliseconds before task is to be executed.     * @param period time in milliseconds between successive task executions.     * @throws IllegalArgumentException if <tt>delay</tt> is negative, or     *         <tt>delay + System.currentTimeMillis()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, timer was cancelled, or timer thread terminated.     */    public void scheduleAtFixedRate(TimerTask task, long delay, long period) {        if (delay < 0)            throw new IllegalArgumentException("Negative delay.");        if (period <= 0)            throw new IllegalArgumentException("Non-positive period.");        sched(task, System.currentTimeMillis()+delay, period);    }    /**     * Schedules the specified task for repeated <i>fixed-rate execution</i>,     * beginning at the specified time. Subsequent executions take place at     * approximately regular intervals, separated by the specified period.     *     * <p>In fixed-rate execution, each execution is scheduled relative to the     * scheduled execution time of the initial execution.  If an execution is     * delayed for any reason (such as garbage collection or other background     * activity), two or more executions will occur in rapid succession to     * "catch up."  In the long run, the frequency of execution will be     * exactly the reciprocal of the specified period (assuming the system     * clock underlying <tt>Object.wait(long)</tt> is accurate).     *     * <p>Fixed-rate execution is appropriate for recurring activities that     * are sensitive to <i>absolute</i> time, such as ringing a chime every     * hour on the hour, or running scheduled maintenance every day at a     * particular time.  It is also appropriate for for recurring activities     * where the total time to perform a fixed number of executions is     * important, such as a countdown timer that ticks once every second for     * ten seconds.  Finally, fixed-rate execution is appropriate for     * scheduling multiple repeating timer tasks that must remain synchronized     * with respect to one another.     *     * @param task   task to be scheduled.     * @param firstTime First time at which task is to be executed.     * @param period time in milliseconds between successive task executions.     * @throws IllegalArgumentException if <tt>time.getTime()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, timer was cancelled, or timer thread terminated.     */    public void scheduleAtFixedRate(TimerTask task, Date firstTime,                                    long period) {        if (period <= 0)            throw new IllegalArgumentException("Non-positive period.");        sched(task, firstTime.getTime(), period);    }    /**     * Schedule the specified timer task for execution at the specified     * time with the specified period, in milliseconds.  If period is     * positive, the task is scheduled for repeated execution; if period is     * zero, the task is scheduled for one-time execution. Time is specified     * in Date.getTime() format.  This method checks timer state, task state,     * and initial execution time, but not period.     *     * @param task   task to be scheduled.     * @param time time at which task is to be executed.     * @param period time in milliseconds between successive task executions.     * @throws IllegalArgumentException if <tt>time()</tt> is negative.     * @throws IllegalStateException if task was already scheduled or     *         cancelled, timer was cancelled, or timer thread terminated.     */    private void sched(TimerTask task, long time, long period) {        if (time < 0)            throw new IllegalArgumentException("Illegal execution time.");                synchronized (queue) {            if (!thread.newTasksMayBeScheduled) {                throw new IllegalStateException("Timer already cancelled.");            }	    /*	     * If the TimerThread has exited without an error	     * it is restarted. See the commentary in TimerThread.run.	     */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区视频免付费| 色猫猫国产区一区二在线视频| 天堂精品中文字幕在线| 婷婷开心激情综合| 精品一区二区三区蜜桃| 久国产精品韩国三级视频| 成人午夜伦理影院| 欧美在线你懂得| 国产亚洲精品7777| 一区二区三区在线视频播放| 日产精品久久久久久久性色| 国产一区二区在线观看免费| 在线观看三级视频欧美| 欧美mv日韩mv国产网站app| 亚洲视频一区二区在线| 久久精品国产网站| 欧美日韩午夜影院| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲国产精品一区二区久久| 国产九色精品成人porny| 欧美日韩免费高清一区色橹橹| 欧美国产成人在线| 国产在线看一区| 日韩一区二区在线播放| 亚洲男同性恋视频| 国产99久久精品| 久久久久久久久99精品| 免费观看91视频大全| 欧美日韩在线免费视频| 国产精品嫩草99a| 成人国产精品免费观看动漫| 国产欧美日韩视频一区二区| 久久国产成人午夜av影院| 777奇米成人网| 免播放器亚洲一区| 26uuu另类欧美亚洲曰本| 国产精品一区二区三区四区| 欧美xingq一区二区| 久久精品国产网站| 中文幕一区二区三区久久蜜桃| 国产精品一区二区你懂的| 久久综合色之久久综合| 国产成人综合在线观看| 国产精品剧情在线亚洲| 日本久久一区二区三区| 日日摸夜夜添夜夜添精品视频| 制服.丝袜.亚洲.中文.综合| 蜜桃av噜噜一区二区三区小说| 欧美日本高清视频在线观看| 日韩和欧美一区二区| 久久综合一区二区| 日本韩国欧美在线| 欧美aaa在线| 国产精品丝袜久久久久久app| 91浏览器在线视频| 麻豆免费精品视频| 国产精品久久一卡二卡| 亚洲欧美日韩国产一区二区三区 | 亚洲午夜电影在线观看| 56国语精品自产拍在线观看| 韩日欧美一区二区三区| 1024国产精品| 日韩精品一区在线观看| 99re视频这里只有精品| 亚洲第一电影网| 国产精品三级电影| 亚洲成人av一区| 亚洲精品一区二区三区在线观看| av动漫一区二区| 国产美女精品在线| 日本欧美大码aⅴ在线播放| 亚洲美女免费视频| 精品动漫一区二区三区在线观看| 91丨九色porny丨蝌蚪| 国产乱人伦偷精品视频不卡| 青草av.久久免费一区| 午夜电影网亚洲视频| 亚洲欧美在线视频观看| 国产精品成人一区二区艾草| 26uuu亚洲婷婷狠狠天堂| 日韩西西人体444www| 7777精品伊人久久久大香线蕉的 | 亚洲aaa精品| 午夜精品福利在线| 日本美女视频一区二区| 秋霞电影一区二区| 男人的天堂亚洲一区| 精品一区二区三区在线视频| 精品午夜一区二区三区在线观看| 精品一二三四区| 国产精品一区二区果冻传媒| av中文字幕在线不卡| 91久久免费观看| 欧美一区二区三区电影| 欧美激情一区二区在线| 亚洲人亚洲人成电影网站色| 午夜精品视频一区| 狠狠色综合日日| 91福利社在线观看| 精品剧情在线观看| 亚洲精品成人少妇| 久久99国内精品| 欧美午夜片在线看| 日韩午夜三级在线| 综合av第一页| www.日韩在线| 91精品麻豆日日躁夜夜躁| 日韩精品综合一本久道在线视频| 91农村精品一区二区在线| 国产福利91精品一区二区三区| 久久精品久久精品| av中文字幕一区| 欧美色爱综合网| 欧美三级蜜桃2在线观看| 日韩欧美国产综合| 亚洲福利一二三区| 91免费视频网址| 国产精品久久久久永久免费观看| 日韩国产欧美一区二区三区| 色综合色狠狠天天综合色| 久久久久久久免费视频了| 日韩av电影免费观看高清完整版| 色综合久久综合网欧美综合网| 欧美精品一区在线观看| 五月天丁香久久| 91香蕉视频在线| 国产精品免费久久| 国产成人av影院| 国产精品视频线看| 懂色av一区二区夜夜嗨| 久久免费电影网| 国产盗摄视频一区二区三区| 国产精品三级在线观看| 99这里只有久久精品视频| ...av二区三区久久精品| 91在线视频官网| 午夜久久久影院| 久久一二三国产| 成人a免费在线看| 一级精品视频在线观看宜春院| 在线一区二区三区四区| 首页亚洲欧美制服丝腿| 精品国产凹凸成av人导航| 国产盗摄一区二区| 亚洲成av人片在线| 久久影音资源网| 欧美中文字幕一二三区视频| 久久精品二区亚洲w码| 中文字幕精品一区二区精品绿巨人| 色婷婷国产精品综合在线观看| 日本伊人色综合网| 国产精品入口麻豆九色| 欧美三级一区二区| 国产乱码精品一品二品| 五月开心婷婷久久| 国产精品久久久久aaaa| 欧美大白屁股肥臀xxxxxx| 91蝌蚪porny| 国产精品一区在线观看乱码 | 久久国产精品第一页| 亚洲欧美日韩在线| 国产欧美综合色| 精品第一国产综合精品aⅴ| 亚洲第一在线综合网站| 免费成人在线网站| 亚洲综合一区二区三区| 国产精品久久久久桃色tv| 久久久影视传媒| 久久久久综合网| 久久老女人爱爱| 久久久美女艺术照精彩视频福利播放| 欧美男生操女生| 欧美日韩国产综合草草| 欧美日韩精品专区| 欧美日韩黄色一区二区| 欧美精品日日鲁夜夜添| 欧美日韩一二区| 精品国产91乱码一区二区三区| 日韩一卡二卡三卡| 久久综合狠狠综合| 中文字幕va一区二区三区| 精品国产凹凸成av人导航| 日韩一级欧美一级| 欧美一区二区三区小说| 91精品国产高清一区二区三区蜜臀 | 日韩avvvv在线播放| 麻豆成人91精品二区三区| 国产精品一区在线观看乱码| 91在线视频18| 精品国产髙清在线看国产毛片| 久久久国产精品麻豆| 樱花草国产18久久久久| 韩国一区二区三区| 色哟哟在线观看一区二区三区| 日韩免费一区二区三区在线播放| 国内精品久久久久影院薰衣草| 欧美视频在线播放| 精品少妇一区二区三区在线播放| 亚洲欧美中日韩| 精品一区二区三区在线播放视频|