分享
 
 
 

java.util.TimerTask翻译

王朝java/jsp·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

[/url] [url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview

Package

Class

Use

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Std. Ed. v1.4.2

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

java.util

Class TimerTaskjava.lang.Object

java.util.TimerTask

All Implemented Interfaces: Runnable public abstract class TimerTask extends Object implements RunnableA task that can be scheduled for one-time or repeated execution by a Timer. 由Timer安排执行一次或重复执行的任务。

Since: 1.3 See Also: TimerConstructor Summary

protected

TimerTask()

Creates a new timer task. 创建一个新的计时任务。

Method Summary

boolean

cancel()

Cancels this timer task. 取消该计时任务。

abstract void

run()

The action to be performed by this timer task. 由计时任务执行的动作。

long

scheduledExecutionTime()

Returns the scheduled execution time of the most recent actual execution of this task. 返回该任务安排的最近实际执行的执行时间。

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TimerTaskprotected TimerTask()

Creates a new timer task. 创建一个新的计时任务。

Method Detail

runpublic abstract void run()

The action to be performed by this timer task. 由计时任务执行的动作。

Specified by: run in interface RunnableSee Also: Thread.run()cancelpublic boolean cancel()

Cancels this timer task. If the task has been scheduled for one-time execution and has not yet run, or has not yet been scheduled, it will never run. If the task has been scheduled for repeated execution, it will never run again. (If the task is running when this call occurs, the task will run to completion, but will never run again.) 取消该计时任务。如果任务已被安排为一次执行并且还没有运行或者还没有被安排,它将不会运行。如果任务被安排为重复执行,它将不会再次运行。(如果调用时任务正在运行,任务将运行至结束,但不会再次运行。) Note that calling this method from within the run method of a repeating timer task absolutely guarantees that the timer task will not run again. 注意在一个重复计时任务的run方法调用此方法可以绝对担保计时任务不会再次运行。

This method may be called repeatedly; the second and subsequent calls have no effect. 该方法可以重复调用,但第二次及其后的调用不起作用。

Returns: true if this task is scheduled for one-time execution and has not yet run, or this task is scheduled for repeated execution. Returns false if the task was scheduled for one-time execution and has already run, or if the task was never scheduled, or if the task was already cancelled. (Loosely speaking, this method returns true if it prevents one or more scheduled executions from taking place.) 如果任务被安排为一次执行而没有运行,或者被安排为重复执行,返回true。 如果任务被安排为一次执行而已经运行,或者任务还没有被安排,或者任务已经被取消,返回false。 (粗略地讲,如果方法阻止一次或多次被安排执行的发生,返回true。)scheduledExecutionTimepublic long scheduledExecutionTime()

Returns the scheduled execution time of the most recent actual execution of this task. (If this method is invoked while task execution is in progress, the return value is the scheduled execution time of the ongoing task execution.) 返回该任务最近实际执行所安排的执行时间。(如果方法调用时任务执行正在进行,那么返回正在进行任务执行的安排执行时间值。) This method is typically invoked from within a task's run method, to determine whether the current execution of the task is sufficiently timely to warrant performing the scheduled activity: 该方法通常在任务的run方法中调用,用来确定是否当前执行的任务是否足够及时保证执行安排的动作:

public void run() {

if (System.currentTimeMillis() - scheduledExecutionTime() >=

MAX_TARDINESS)

return; // Too late; skip this execution.

// Perform the task

}

This method is typically not used in conjunction with fixed-delay execution repeating tasks, as their scheduled execution times are allowed to drift over time, and so are not terribly significant. 该方法通常不在固定延迟的执行重复任务的连接中使用,因为 它们的执行时间允许超时,所以意义不明显。

Returns: the time at which the most recent execution of this task was scheduled to occur, in the format returned by Date.getTime(). The return value is undefined if the task has yet to commence its first execution. 任务的最近执行被安排的时间,以格式Date.getTime()返回。如果任务还未开始它的第一次执行, 返回值不确定。 See Also: Date.getTime()[/url][url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview

Package

Class

Use

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Std. Ed. v1.4.2

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature

For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有