OSDN Git Service

4c242288dc288994034c69aedaea935b4b150eba
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / docs / apidocs / lejos / util / Timer.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.5.0_09) on Sun Sep 02 23:07:08 BST 2007 -->
6 <TITLE>
7 Timer (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="lejos.util.Timer class">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17     parent.document.title="Timer (leJOS NXT API documentation)";
18 }
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
22
23 </HEAD>
24
25 <BODY BGCOLOR="white" onload="windowTitle();">
26
27
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36   <TR ALIGN="center" VALIGN="top">
37   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44   </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
51
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../lejos/util/Recycler.html" title="class in lejos.util"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;<A HREF="../../lejos/util/TimerListener.html" title="interface in lejos.util"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57   <A HREF="../../index.html?lejos/util/Timer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58 &nbsp;<A HREF="Timer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60   <!--
61   if(window==top) {
62     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
63   }
64   //-->
65 </SCRIPT>
66 <NOSCRIPT>
67   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
69
70
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
82
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 lejos.util</FONT>
88 <BR>
89 Class Timer</H2>
90 <PRE>
91 <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
92   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>lejos.util.Timer</B>
93 </PRE>
94 <HR>
95 <DL>
96 <DT><PRE>public class <B>Timer</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>
97 </PRE>
98
99 <P>
100 Timer object, with some similar functionality to java.Swing.Timer.
101 <P>
102
103 <P>
104 <DL>
105 <DT><B>Author:</B></DT>
106   <DD><a href="mailto:rvbijl39<at>calvin<dot>edu">Ryan VanderBijl</a></DD>
107 </DL>
108 <HR>
109
110 <P>
111
112 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
113
114 <A NAME="constructor_summary"><!-- --></A>
115 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
116 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
117 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
118 <B>Constructor Summary</B></FONT></TH>
119 </TR>
120 <TR BGCOLOR="white" CLASS="TableRowColor">
121 <TD><CODE><B><A HREF="../../lejos/util/Timer.html#Timer(int, lejos.util.TimerListener)">Timer</A></B>(int&nbsp;theDelay,
122       <A HREF="../../lejos/util/TimerListener.html" title="interface in lejos.util">TimerListener</A>&nbsp;el)</CODE>
123
124 <BR>
125 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a Timer object.</TD>
126 </TR>
127 </TABLE>
128 &nbsp;
129 <!-- ========== METHOD SUMMARY =========== -->
130
131 <A NAME="method_summary"><!-- --></A>
132 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
133 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
134 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
135 <B>Method Summary</B></FONT></TH>
136 </TR>
137 <TR BGCOLOR="white" CLASS="TableRowColor">
138 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
139 <CODE>&nbsp;int</CODE></FONT></TD>
140 <TD><CODE><B><A HREF="../../lejos/util/Timer.html#getDelay()">getDelay</A></B>()</CODE>
141
142 <BR>
143 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;access how man milliseconds between timedOut() messages.</TD>
144 </TR>
145 <TR BGCOLOR="white" CLASS="TableRowColor">
146 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147 <CODE>&nbsp;void</CODE></FONT></TD>
148 <TD><CODE><B><A HREF="../../lejos/util/Timer.html#setDelay(int)">setDelay</A></B>(int&nbsp;newDelay)</CODE>
149
150 <BR>
151 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Change the delay between timedOut messages.</TD>
152 </TR>
153 <TR BGCOLOR="white" CLASS="TableRowColor">
154 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
155 <CODE>&nbsp;void</CODE></FONT></TD>
156 <TD><CODE><B><A HREF="../../lejos/util/Timer.html#start()">start</A></B>()</CODE>
157
158 <BR>
159 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the timer, telling it to send timeOut() methods
160  to the TimerListener.</TD>
161 </TR>
162 <TR BGCOLOR="white" CLASS="TableRowColor">
163 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
164 <CODE>&nbsp;void</CODE></FONT></TD>
165 <TD><CODE><B><A HREF="../../lejos/util/Timer.html#stop()">stop</A></B>()</CODE>
166
167 <BR>
168 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stops the timer.</TD>
169 </TR>
170 </TABLE>
171 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
172 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
173 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
174 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
175 </TR>
176 <TR BGCOLOR="white" CLASS="TableRowColor">
177 <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></CODE></TD>
178 </TR>
179 </TABLE>
180 &nbsp;
181 <P>
182
183 <!-- ========= CONSTRUCTOR DETAIL ======== -->
184
185 <A NAME="constructor_detail"><!-- --></A>
186 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
187 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
188 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
189 <B>Constructor Detail</B></FONT></TH>
190 </TR>
191 </TABLE>
192
193 <A NAME="Timer(int, lejos.util.TimerListener)"><!-- --></A><H3>
194 Timer</H3>
195 <PRE>
196 public <B>Timer</B>(int&nbsp;theDelay,
197              <A HREF="../../lejos/util/TimerListener.html" title="interface in lejos.util">TimerListener</A>&nbsp;el)</PRE>
198 <DL>
199 <DD>Create a Timer object. Every theDelay milliseconds
200  the el.timedOut() function is called. You may
201  change the delay with setDelay(int). You need
202  to call start() explicitly.
203 <P>
204 </DL>
205
206 <!-- ============ METHOD DETAIL ========== -->
207
208 <A NAME="method_detail"><!-- --></A>
209 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
210 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
211 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
212 <B>Method Detail</B></FONT></TH>
213 </TR>
214 </TABLE>
215
216 <A NAME="getDelay()"><!-- --></A><H3>
217 getDelay</H3>
218 <PRE>
219 public int <B>getDelay</B>()</PRE>
220 <DL>
221 <DD>access how man milliseconds between timedOut() messages.
222 <P>
223 <DD><DL>
224 </DL>
225 </DD>
226 </DL>
227 <HR>
228
229 <A NAME="setDelay(int)"><!-- --></A><H3>
230 setDelay</H3>
231 <PRE>
232 public void <B>setDelay</B>(int&nbsp;newDelay)</PRE>
233 <DL>
234 <DD>Change the delay between timedOut messages. Safe to call
235  while start()ed. Time in milli-seconds.
236 <P>
237 <DD><DL>
238 </DL>
239 </DD>
240 </DL>
241 <HR>
242
243 <A NAME="stop()"><!-- --></A><H3>
244 stop</H3>
245 <PRE>
246 public void <B>stop</B>()</PRE>
247 <DL>
248 <DD>Stops the timer. timedOut() messages are not sent.
249 <P>
250 <DD><DL>
251 </DL>
252 </DD>
253 </DL>
254 <HR>
255
256 <A NAME="start()"><!-- --></A><H3>
257 start</H3>
258 <PRE>
259 public void <B>start</B>()</PRE>
260 <DL>
261 <DD>Starts the timer, telling it to send timeOut() methods
262  to the TimerListener.
263 <P>
264 <DD><DL>
265 </DL>
266 </DD>
267 </DL>
268 <!-- ========= END OF CLASS DATA ========= -->
269 <HR>
270
271
272 <!-- ======= START OF BOTTOM NAVBAR ====== -->
273 <A NAME="navbar_bottom"><!-- --></A>
274 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
275 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
276 <TR>
277 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
278 <A NAME="navbar_bottom_firstrow"><!-- --></A>
279 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
280   <TR ALIGN="center" VALIGN="top">
281   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
282   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
283   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
284   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
285   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
286   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
287   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
288   </TR>
289 </TABLE>
290 </TD>
291 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
292 </EM>
293 </TD>
294 </TR>
295
296 <TR>
297 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
298 &nbsp;<A HREF="../../lejos/util/Recycler.html" title="class in lejos.util"><B>PREV CLASS</B></A>&nbsp;
299 &nbsp;<A HREF="../../lejos/util/TimerListener.html" title="interface in lejos.util"><B>NEXT CLASS</B></A></FONT></TD>
300 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
301   <A HREF="../../index.html?lejos/util/Timer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
302 &nbsp;<A HREF="Timer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
303 &nbsp;<SCRIPT type="text/javascript">
304   <!--
305   if(window==top) {
306     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
307   }
308   //-->
309 </SCRIPT>
310 <NOSCRIPT>
311   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
312 </NOSCRIPT>
313
314
315 </FONT></TD>
316 </TR>
317 <TR>
318 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
319   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
320 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
321 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
322 </TR>
323 </TABLE>
324 <A NAME="skip-navbar_bottom"></A>
325 <!-- ======== END OF BOTTOM NAVBAR ======= -->
326
327 <HR>
328
329 </BODY>
330 </HTML>