Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


TimerTaskjava.util

Java 1.3runnable

This
abstract Runnable class represents a task that is
scheduled with a Timer object for one-time or
repeated execution in the future. You can define a task by
subclassing TimerTask and implementing the
abstract run( ) method. Schedule the task for
future execution by passing an instance of your subclass to one of
the schedule( ) or scheduleAtFixedRate(
) methods of Timer. The
Timer object will then invoke the run(
) method at the scheduled time or times.

Call cancel( )
to cancel the one-time or repeated execution of a TimerTask(
). This method returns TRue if a pending
execution was actually canceled. It returns false
if the task has already been canceled, was never scheduled, or was
scheduled for one-time execution and has already been executed.
scheduledExecutionTime( ) returns the time in
milliseconds at which the most recent execution of the
TimerTask was scheduled to occur. When the host
system is heavily loaded, the run( ) method may
not be invoked exactly when scheduled. Some tasks may choose to do
nothing if they are not invoked on time. The run(
) method can compare the return values of
scheduledExecutionTime( ) and
System.currentTimeMillis( ) to determine whether
the current invocation is sufficiently timely.


Figure 16-60. java.util.TimerTask

public abstract class

TimerTask implements Runnable {
// Protected Constructors
protected

TimerTask ( );
// Public Instance Methods
public boolean

cancel ( );
public long

scheduledExecutionTime ( );
// Methods Implementing Runnable
public abstract void

run ( );
}


Passed To


Timer.{schedule( ), scheduleAtFixedRate(
)}


    / 1191