|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.appserver.WOTimer
WOTimer creates timer objects, or more simply, timers. A timer waits until its fireDate
is reached and then fires, sending a specified message to a specified object. If you
specify that the timer should repeat, it automatically reschedules itself after it fires.
The static method scheduledTimer
creates and schedules a timer. The
constructors create timers which can later be scheduled by invoking the method schedule
.
Timers can be unscheduled by invoking invalidate
on the timer to be unscheduled.
fireDate()
,
invalidate()
,
schedule()
,
scheduledTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, boolean repeats)
,
scheduledTimer(long ti, Object aTarget, String aSelectorName, Object anArgument, Class anArgumentClass, boolean repeats)
Constructor Summary | |
WOTimer(long ti,
Object aTarget,
String aSelectorName,
Object userInfo,
Class userInfoClass,
boolean repeats)
Creates a timer which will fire after ti milliseconds, and at
intervals ti thereafter (if repeats is true ). |
|
WOTimer(NSTimestamp fireDate,
long ti,
Object aTarget,
String aSelectorName,
Object userInfo,
Class userInfoClass,
boolean repeats)
Creates a timer which will fire at fireDate , and at
intervals ti thereafter (if repeats is true ). |
Method Summary | |
boolean |
equals(Object aTimer)
Return true if aTimer is an instance of WOTimer with
the same selector , target , and
userInfo as the receiver. |
void |
fire()
Fires the timer, invoking selector on target and passing
either the WOTimer -- if userInfoClass was null when the
WOTimer was created -- or userInfo . |
NSTimestamp |
fireDate()
Return the NSTimestamp at which the WOTimer will first fire. |
int |
hashCode()
|
void |
invalidate()
Unschedules the timer and marks it as invalid. |
boolean |
isValid()
Returns whether or not the timer is valid. |
void |
schedule()
Schedule the WOTimer to be fired. |
static WOTimer |
scheduledTimer(long ti,
Object aTarget,
String aSelectorName,
Object userInfo,
boolean repeats)
Creates a timer which will fire after ti milliseconds, and at
intervals ti thereafter (if repeats is true ). |
static WOTimer |
scheduledTimer(long ti,
Object aTarget,
String aSelectorName,
Object anArgument,
Class anArgumentClass,
boolean repeats)
Creates a timer which will fire after ti milliseconds, and at
intervals ti thereafter (if repeats is true ). |
NSSelector |
selector()
Returns the NSSelector which will be invoked when the WOTimer fires. |
Object |
target()
Returns the object on which selector will be invoked when the WOTimer fires. |
double |
timeInterval()
Return the interval in seconds at which the WOTimer will repeat firing. |
String |
toString()
|
Object |
userInfo()
Returns the userInfo object that was passed when the timer was created. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)
ti
milliseconds, and at
intervals ti
thereafter (if repeats
is true
).
If userInfoClass
is null
,
aSelectorName
must take an object of class WOTimer as a
parameter, and userInfo
will be available to the selector
invoking userInfo
on the parameter timer. Otherwise,
aSelectorName
must take an object of class userInfoClass
and userInfo
must be an object of this class.
ti
- the interval in milliseconds between successive firings of the timeraTarget
- the method on which aSelectorName
will be invokedaSelectorName
- the method to be invoked when the timer firesuserInfo
- user information that should be passed on when the timer firesuserInfoClass
- the class of userInfo
repeats
- whether or not the timer should fire repeatedlyWOTimer(NSTimestamp fireDate, long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeat)
public WOTimer(NSTimestamp fireDate, long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)
fireDate
, and at
intervals ti
thereafter (if repeats
is true
).
If userInfoClass
is null
,
aSelectorName
must take an object of class WOTimer as a
parameter, and userInfo
will be available to the selector
invoking userInfo
on the parameter timer. Otherwise,
aSelectorName
must take an object of class userInfoClass
and userInfo
must be an object of this class.
fireDate
- the time at which the timer should first fireti
- the interval in milliseconds between successive firings of the timeraTarget
- the method on which aSelectorName
will be invokedaSelectorName
- the method to be invoked when the timer firesuserInfo
- user information that should be passed on when the timer firesuserInfoClass
- the class of userInfo
repeats
- whether or not the timer should fire repeatedlyWOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeat)
Method Detail |
public boolean equals(Object aTimer)
aTimer
is an instance of WOTimer with
the same selector
, target
, and
userInfo
as the receiver.
aTimer
- the timer to be compared
true
if the objects are equalselector()
,
target()
,
userInfo()
public void fire()
selector
on target
and passing
either the WOTimer -- if userInfoClass
was null
when the
WOTimer was created -- or userInfo
.
selector()
,
target()
,
userInfo()
public NSTimestamp fireDate()
public int hashCode()
public void invalidate()
schedule()
public boolean isValid()
true
if the timer is validpublic void schedule()
invalidate()
public static WOTimer scheduledTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, boolean repeats)
ti
milliseconds, and at
intervals ti
thereafter (if repeats
is true
).
aSelectorName
must take an object of class WOTimer as a
parameter, and userInfo
will be available to the selector
invoking userInfo
on the parameter timer.
ti
- the interval in milliseconds between successive firings of the timeraTarget
- the method on which aSelectorName
will be invokedaSelectorName
- the method to be invoked when the timer firesuserInfo
- user information that should be passed on when the timer firesrepeats
- whether or not the timer should fire repeatedly
true
if the timer was scheduled successfully, false
otherwiseWOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeat)
public static WOTimer scheduledTimer(long ti, Object aTarget, String aSelectorName, Object anArgument, Class anArgumentClass, boolean repeats)
ti
milliseconds, and at
intervals ti
thereafter (if repeats
is true
).
If anArgumentClass
is null
,
aSelectorName
must take an object of class WOTimer as a
parameter, and userInfo
will be available to the selector
invoking userInfo
on the parameter timer. Otherwise,
aSelectorName
must take an object of class anArgumentClass
and anArgument
must be an object of this class.
ti
- the interval in milliseconds between successive firings of the timeraTarget
- the method on which aSelectorName
will be invokedaSelectorName
- the method to be invoked when the timer firesanArgument
- parmeter that will be passed to aSelectorName
when it is invokedanArgumentClass
- the class of anArgument
repeats
- whether or not the timer should fire repeatedly
true
if the timer was scheduled successfully, false
otherwiseWOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeat)
public NSSelector selector()
public Object target()
selector
will be invoked when the WOTimer fires.
selector
will be invokedselector()
public double timeInterval()
public String toString()
public Object userInfo()
userInfo
object that was passed when the timer was created.
userInfo
object that was passed when the timer was created
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |