<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_03) on Mon Oct 10 16:31:47 CEST 2005 -->
<TITLE>
Timer (IM Profile)
</TITLE>

<META NAME="keywords" CONTENT="java.util.Timer class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="Timer (IM Profile)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Timer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>IM Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/util/Stack.html" title="class in java.util"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/util/TimerTask.html" title="class in java.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Timer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.util</FONT>
<BR>
Class Timer</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
  <IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.util.Timer</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Timer</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>

<P>
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.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>1.3</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/util/TimerTask.html" title="class in java.util"><CODE>TimerTask</CODE></A>, 
<A HREF="../../java/lang/Object.html#wait(long)"><CODE>Object.wait(long)</CODE></A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/util/Timer.html#Timer()">Timer</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new timer.  </TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#cancel()">cancel</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Terminates this timer, discarding any currently scheduled tasks.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#schedule(java.util.TimerTask, java.util.Date)">schedule</A></B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
         <A HREF="../../java/util/Date.html" title="class in java.util">Date</A>&nbsp;time)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schedules the specified task for execution at the specified time.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#schedule(java.util.TimerTask, java.util.Date, long)">schedule</A></B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
         <A HREF="../../java/util/Date.html" title="class in java.util">Date</A>&nbsp;firstTime,
         long&nbsp;period)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schedules the specified task for repeated <i>fixed-delay execution</i>,
 beginning at the specified time. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#schedule(java.util.TimerTask, long)">schedule</A></B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
         long&nbsp;delay)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schedules the specified task for execution after the specified delay.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#schedule(java.util.TimerTask, long, long)">schedule</A></B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
         long&nbsp;delay,
         long&nbsp;period)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schedules the specified task for repeated <i>fixed-delay execution</i>,
 beginning after the specified delay.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#scheduleAtFixedRate(java.util.TimerTask, java.util.Date, long)">scheduleAtFixedRate</A></B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                    <A HREF="../../java/util/Date.html" title="class in java.util">Date</A>&nbsp;firstTime,
                    long&nbsp;period)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schedules the specified task for repeated <i>fixed-rate execution</i>,
 beginning at the specified time. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Timer.html#scheduleAtFixedRate(java.util.TimerTask, long, long)">scheduleAtFixedRate</A></B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                    long&nbsp;delay,
                    long&nbsp;period)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schedules the specified task for repeated <i>fixed-rate execution</i>,
 beginning after the specified delay.  </TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="Timer()"><!-- --></A><H3>
Timer</H3>
<PRE>
public <B>Timer</B>()</PRE>
<DL>
<DD>Creates a new timer.  The associated thread does <i>not</i> run as
 a daemon thread, which may prevent an application from terminating.
<P>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html" title="class in java.lang"><CODE>Thread</CODE></A>, 
<A HREF="../../java/util/Timer.html#cancel()"><CODE>cancel()</CODE></A></DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="schedule(java.util.TimerTask, long)"><!-- --></A><H3>
schedule</H3>
<PRE>
public void <B>schedule</B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                     long&nbsp;delay)</PRE>
<DL>
<DD>Schedules the specified task for execution after the specified delay.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>task</CODE> - task to be scheduled.<DD><CODE>delay</CODE> - delay in milliseconds before task is to be executed.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if <tt>delay</tt> is negative, or
         <tt>delay + System.currentTimeMillis()</tt> is negative.
<DD><CODE><A HREF="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</A></CODE> - if task was already scheduled or
         cancelled, or timer was cancelled.</DL>
</DD>
</DL>
<HR>

<A NAME="schedule(java.util.TimerTask, java.util.Date)"><!-- --></A><H3>
schedule</H3>
<PRE>
public void <B>schedule</B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                     <A HREF="../../java/util/Date.html" title="class in java.util">Date</A>&nbsp;time)</PRE>
<DL>
<DD>Schedules the specified task for execution at the specified time.  If
 the time is in the past, the task is scheduled for immediate execution.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>task</CODE> - task to be scheduled.<DD><CODE>time</CODE> - time at which task is to be executed.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if <tt>time.getTime()</tt> is negative.
<DD><CODE><A HREF="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</A></CODE> - if task was already scheduled or
         cancelled, timer was cancelled, or timer thread terminated.</DL>
</DD>
</DL>
<HR>

<A NAME="schedule(java.util.TimerTask, long, long)"><!-- --></A><H3>
schedule</H3>
<PRE>
public void <B>schedule</B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                     long&nbsp;delay,
                     long&nbsp;period)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>task</CODE> - task to be scheduled.<DD><CODE>delay</CODE> - delay in milliseconds before task is to be executed.<DD><CODE>period</CODE> - time in milliseconds between successive task executions.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if <tt>delay</tt> is negative, or
         <tt>delay + System.currentTimeMillis()</tt> is negative.
<DD><CODE><A HREF="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</A></CODE> - if task was already scheduled or
         cancelled, timer was cancelled, or timer thread terminated.</DL>
</DD>
</DL>
<HR>

<A NAME="schedule(java.util.TimerTask, java.util.Date, long)"><!-- --></A><H3>
schedule</H3>
<PRE>
public void <B>schedule</B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                     <A HREF="../../java/util/Date.html" title="class in java.util">Date</A>&nbsp;firstTime,
                     long&nbsp;period)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>task</CODE> - task to be scheduled.<DD><CODE>firstTime</CODE> - First time at which task is to be executed.<DD><CODE>period</CODE> - time in milliseconds between successive task executions.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if <tt>time.getTime()</tt> is negative.
<DD><CODE><A HREF="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</A></CODE> - if task was already scheduled or
         cancelled, timer was cancelled, or timer thread terminated.</DL>
</DD>
</DL>
<HR>

<A NAME="scheduleAtFixedRate(java.util.TimerTask, long, long)"><!-- --></A><H3>
scheduleAtFixedRate</H3>
<PRE>
public void <B>scheduleAtFixedRate</B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                                long&nbsp;delay,
                                long&nbsp;period)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>task</CODE> - task to be scheduled.<DD><CODE>delay</CODE> - delay in milliseconds before task is to be executed.<DD><CODE>period</CODE> - time in milliseconds between successive task executions.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if <tt>delay</tt> is negative, or
         <tt>delay + System.currentTimeMillis()</tt> is negative.
<DD><CODE><A HREF="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</A></CODE> - if task was already scheduled or
         cancelled, timer was cancelled, or timer thread terminated.</DL>
</DD>
</DL>
<HR>

<A NAME="scheduleAtFixedRate(java.util.TimerTask, java.util.Date, long)"><!-- --></A><H3>
scheduleAtFixedRate</H3>
<PRE>
public void <B>scheduleAtFixedRate</B>(<A HREF="../../java/util/TimerTask.html" title="class in java.util">TimerTask</A>&nbsp;task,
                                <A HREF="../../java/util/Date.html" title="class in java.util">Date</A>&nbsp;firstTime,
                                long&nbsp;period)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>task</CODE> - task to be scheduled.<DD><CODE>firstTime</CODE> - First time at which task is to be executed.<DD><CODE>period</CODE> - time in milliseconds between successive task executions.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if <tt>time.getTime()</tt> is negative.
<DD><CODE><A HREF="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</A></CODE> - if task was already scheduled or
         cancelled, timer was cancelled, or timer thread terminated.</DL>
</DD>
</DL>
<HR>

<A NAME="cancel()"><!-- --></A><H3>
cancel</H3>
<PRE>
public void <B>cancel</B>()</PRE>
<DL>
<DD>Terminates this timer, discarding any currently scheduled tasks.
 Does not interfere with a currently executing task (if it exists).
 Once a timer has been terminated, its execution thread terminates
 gracefully, and no more tasks may be scheduled on it.

 <p>Note that calling this method from within the run method of a
 timer task that was invoked by this timer absolutely guarantees that
 the ongoing task execution is the last task execution that will ever
 be performed by this timer.

 <p>This method may be called repeatedly; the second and subsequent 
 calls have no effect.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Timer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>IM Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/util/Stack.html" title="class in java.util"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/util/TimerTask.html" title="class in java.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Timer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size=\-1\><a href=\mailto:midp-feedback@risc.sps.mot.com\>Submit a comment or suggestion</a> Version 2.0 of IM Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>
