<!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>
Thread (IM Profile)
</TITLE>

<META NAME="keywords" CONTENT="java.lang.Thread class">

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

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="Thread (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/Thread.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/lang/System.html" title="class in java.lang"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/lang/Throwable.html" title="class in java.lang"><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="Thread.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;<A HREF="#field_summary">FIELD</A>&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;<A HREF="#field_detail">FIELD</A>&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.lang</FONT>
<BR>
Class Thread</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.lang.Thread</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>Thread</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A><DT>implements <A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A></DL>

<P>
A <i>thread</i> is a thread of execution in a program. The Java
 Virtual Machine allows an application to have multiple threads of
 execution running concurrently.
 <p>
 Every thread has a priority. Threads with higher priority are
 executed in preference to threads with lower priority.
 <p>
 There are two ways to create a new thread of execution. One is to
 declare a class to be a subclass of <code>Thread</code>. This
 subclass should override the <code>run</code> method of class
 <code>Thread</code>. An instance of the subclass can then be
 allocated and started. For example, a thread that computes primes
 larger than a stated value could be written as follows:
 <p><hr><blockquote><pre>
     class PrimeThread extends Thread {
         long minPrime;
         PrimeThread(long minPrime) {
             this.minPrime = minPrime;
         }

         public void run() {
             // compute primes larger than minPrime
             &nbsp;.&nbsp;.&nbsp;.
         }
     }
 </pre></blockquote><hr>
 <p>
 The following code would then create a thread and start it running:
 <p><blockquote><pre>
     PrimeThread p = new PrimeThread(143);
     p.start();
 </pre></blockquote>
 <p>
 The other way to create a thread is to declare a class that
 implements the <code>Runnable</code> interface. That class then
 implements the <code>run</code> method. An instance of the class can
 then be allocated, passed as an argument when creating
 <code>Thread</code>, and started. The same example in this other
 style looks like the following:
 <p><hr><blockquote><pre>
     class PrimeRun implements Runnable {
         long minPrime;
         PrimeRun(long minPrime) {
             this.minPrime = minPrime;
         }

         public void run() {
             // compute primes larger than minPrime
             &nbsp;.&nbsp;.&nbsp;.
         }
     }
 </pre></blockquote><hr>
 <p>
 The following code would then create a thread and start it running:
 <p><blockquote><pre>
     PrimeRun p = new PrimeRun(143);
     new Thread(p).start();
 </pre></blockquote>
 <p>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>JDK1.0, CLDC 1.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Runnable.html" title="interface in java.lang"><CODE>Runnable</CODE></A>, 
<A HREF="../../java/lang/Runtime.html#exit(int)"><CODE>Runtime.exit(int)</CODE></A>, 
<A HREF="../../java/lang/Thread.html#run()"><CODE>run()</CODE></A></DL>
<HR>

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


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

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#MAX_PRIORITY">MAX_PRIORITY</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The maximum priority that a thread can have.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#MIN_PRIORITY">MIN_PRIORITY</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The minimum priority that a thread can have.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#NORM_PRIORITY">NORM_PRIORITY</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The default priority that is assigned to a thread.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== 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/lang/Thread.html#Thread()">Thread</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a new <code>Thread</code> object.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Thread.html#Thread(java.lang.Runnable)">Thread</A></B>(<A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A>&nbsp;target)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a new <code>Thread</code> object with a
 specific target object whose <code>run</code> method
 is called.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Thread.html#Thread(java.lang.Runnable, java.lang.String)">Thread</A></B>(<A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A>&nbsp;target,
       <A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a new <code>Thread</code> object with the given
 target and name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Thread.html#Thread(java.lang.String)">Thread</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a new <code>Thread</code> object with the
 given name.

 </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>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#activeCount()">activeCount</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current number of active threads in the virtual machine.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#currentThread()">currentThread</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a reference to the currently executing
 <code>Thread</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#getName()">getName</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns this thread's name.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#getPriority()">getPriority</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns this thread's priority.</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/lang/Thread.html#interrupt()">interrupt</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupts this thread.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#isAlive()">isAlive</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if this thread is alive. </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/lang/Thread.html#join()">join</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Waits for this thread to die.</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/lang/Thread.html#run()">run</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If this thread was constructed using a separate
 <code>Runnable</code> run object, then that
 <code>Runnable</code> object's <code>run</code> method is called;
 otherwise, this method does nothing and returns.
 </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/lang/Thread.html#setPriority(int)">setPriority</A></B>(int&nbsp;newPriority)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changes the priority of this thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#sleep(long)">sleep</A></B>(long&nbsp;millis)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Causes the currently executing thread to sleep (temporarily cease
 execution) for the specified number of milliseconds. </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/lang/Thread.html#start()">start</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Causes this thread to begin execution; the Java Virtual Machine
 calls the <code>run</code> method of this thread.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#toString()">toString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string representation of this thread, including the
 thread's name and priority.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Thread.html#yield()">yield</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Causes the currently executing thread object
 to temporarily pause and allow other threads to execute.</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#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 =========== -->

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

<A NAME="MIN_PRIORITY"><!-- --></A><H3>
MIN_PRIORITY</H3>
<PRE>
public static final int <B>MIN_PRIORITY</B></PRE>
<DL>
<DD>The minimum priority that a thread can have.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../constant-values.html#java.lang.Thread.MIN_PRIORITY">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="NORM_PRIORITY"><!-- --></A><H3>
NORM_PRIORITY</H3>
<PRE>
public static final int <B>NORM_PRIORITY</B></PRE>
<DL>
<DD>The default priority that is assigned to a thread.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../constant-values.html#java.lang.Thread.NORM_PRIORITY">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="MAX_PRIORITY"><!-- --></A><H3>
MAX_PRIORITY</H3>
<PRE>
public static final int <B>MAX_PRIORITY</B></PRE>
<DL>
<DD>The maximum priority that a thread can have.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../constant-values.html#java.lang.Thread.MAX_PRIORITY">Constant Field Values</A></DL>
</DL>

<!-- ========= 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="Thread()"><!-- --></A><H3>
Thread</H3>
<PRE>
public <B>Thread</B>()</PRE>
<DL>
<DD>Allocates a new <code>Thread</code> object.
 <p>
 Threads created this way must have overridden their
 <code>run()</code> method to actually do anything.
<P>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Runnable.html" title="interface in java.lang"><CODE>Runnable</CODE></A></DL>
<HR>

<A NAME="Thread(java.lang.String)"><!-- --></A><H3>
Thread</H3>
<PRE>
public <B>Thread</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</PRE>
<DL>
<DD>Allocates a new <code>Thread</code> object with the
 given name.

 Threads created this way must have overridden their
 <code>run()</code> method to actually do anything.
<P>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the new thread.</DL>
<HR>

<A NAME="Thread(java.lang.Runnable)"><!-- --></A><H3>
Thread</H3>
<PRE>
public <B>Thread</B>(<A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A>&nbsp;target)</PRE>
<DL>
<DD>Allocates a new <code>Thread</code> object with a
 specific target object whose <code>run</code> method
 is called.
<P>
<DT><B>Parameters:</B><DD><CODE>target</CODE> - the object whose <code>run</code> method is called.</DL>
<HR>

<A NAME="Thread(java.lang.Runnable, java.lang.String)"><!-- --></A><H3>
Thread</H3>
<PRE>
public <B>Thread</B>(<A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A>&nbsp;target,
              <A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</PRE>
<DL>
<DD>Allocates a new <code>Thread</code> object with the given
 target and name.
<P>
<DT><B>Parameters:</B><DD><CODE>target</CODE> - the object whose <code>run</code> method is called.<DD><CODE>name</CODE> - the name of the new thread.</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="currentThread()"><!-- --></A><H3>
currentThread</H3>
<PRE>
public static <A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A> <B>currentThread</B>()</PRE>
<DL>
<DD>Returns a reference to the currently executing
 <code>Thread</code> object.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the currently executing thread.</DL>
</DD>
</DL>
<HR>

<A NAME="yield()"><!-- --></A><H3>
yield</H3>
<PRE>
public static void <B>yield</B>()</PRE>
<DL>
<DD>Causes the currently executing thread object
 to temporarily pause and allow other threads to execute.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="sleep(long)"><!-- --></A><H3>
sleep</H3>
<PRE>
public static void <B>sleep</B>(long&nbsp;millis)
                  throws <A HREF="../../java/lang/InterruptedException.html" title="class in java.lang">InterruptedException</A></PRE>
<DL>
<DD>Causes the currently executing thread to sleep (temporarily cease
 execution) for the specified number of milliseconds. The thread
 does not lose ownership of any monitors.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>millis</CODE> - the length of time to sleep in milliseconds.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/InterruptedException.html" title="class in java.lang">InterruptedException</A></CODE> - if another thread has interrupted
             the current thread.  The <i>interrupted status</i> of the
             current thread is cleared when this exception is thrown.<DT><B>See Also:</B><DD><A HREF="../../java/lang/Object.html#notify()"><CODE>Object.notify()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="start()"><!-- --></A><H3>
start</H3>
<PRE>
public void <B>start</B>()</PRE>
<DL>
<DD>Causes this thread to begin execution; the Java Virtual Machine
 calls the <code>run</code> method of this thread.
 <p>
 The result is that two threads are running concurrently: the
 current thread (which returns from the call to the
 <code>start</code> method) and the other thread (which executes its
 <code>run</code> method).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalThreadStateException.html" title="class in java.lang">IllegalThreadStateException</A></CODE> - if the thread was already
               started.<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html#run()"><CODE>run()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="run()"><!-- --></A><H3>
run</H3>
<PRE>
public void <B>run</B>()</PRE>
<DL>
<DD>If this thread was constructed using a separate
 <code>Runnable</code> run object, then that
 <code>Runnable</code> object's <code>run</code> method is called;
 otherwise, this method does nothing and returns.
 <p>
 Subclasses of <code>Thread</code> should override this method.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/lang/Runnable.html#run()">run</A></CODE> in interface <CODE><A HREF="../../java/lang/Runnable.html" title="interface in java.lang">Runnable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html#start()"><CODE>start()</CODE></A>, 
<A HREF="../../java/lang/Runnable.html#run()"><CODE>Runnable.run()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="interrupt()"><!-- --></A><H3>
interrupt</H3>
<PRE>
public void <B>interrupt</B>()</PRE>
<DL>
<DD>Interrupts this thread.  In an implementation conforming
 to the CLDC Specification, this operation is not
 required to cancel or clean up any pending I/O operations
 that the thread may be waiting for.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Since:</B></DT>
  <DD>JDK 1.0, CLDC 1.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="isAlive()"><!-- --></A><H3>
isAlive</H3>
<PRE>
public final boolean <B>isAlive</B>()</PRE>
<DL>
<DD>Tests if this thread is alive. A thread is alive if it has
 been started and has not yet died.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if this thread is alive;
          <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>

<A NAME="setPriority(int)"><!-- --></A><H3>
setPriority</H3>
<PRE>
public final void <B>setPriority</B>(int&nbsp;newPriority)</PRE>
<DL>
<DD>Changes the priority of this thread.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newPriority</CODE> - priority to set this thread to
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - If the priority is not in the
             range <code>MIN_PRIORITY</code> to
             <code>MAX_PRIORITY</code>.<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html#getPriority()"><CODE>getPriority()</CODE></A>, 
<A HREF="../../java/lang/Thread.html#MAX_PRIORITY"><CODE>MAX_PRIORITY</CODE></A>, 
<A HREF="../../java/lang/Thread.html#MIN_PRIORITY"><CODE>MIN_PRIORITY</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getPriority()"><!-- --></A><H3>
getPriority</H3>
<PRE>
public final int <B>getPriority</B>()</PRE>
<DL>
<DD>Returns this thread's priority.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>this thread's priority.<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html#setPriority(int)"><CODE>setPriority(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getName()"><!-- --></A><H3>
getName</H3>
<PRE>
public final <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>getName</B>()</PRE>
<DL>
<DD>Returns this thread's name.  Note that in CLDC the name
 of the thread can only be set when creating the thread.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>this thread's name.</DL>
</DD>
</DL>
<HR>

<A NAME="activeCount()"><!-- --></A><H3>
activeCount</H3>
<PRE>
public static int <B>activeCount</B>()</PRE>
<DL>
<DD>Returns the current number of active threads in the virtual machine.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the current number of active threads.</DL>
</DD>
</DL>
<HR>

<A NAME="join()"><!-- --></A><H3>
join</H3>
<PRE>
public final void <B>join</B>()
                throws <A HREF="../../java/lang/InterruptedException.html" title="class in java.lang">InterruptedException</A></PRE>
<DL>
<DD>Waits for this thread to die.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/InterruptedException.html" title="class in java.lang">InterruptedException</A></CODE> - if another thread has interrupted
             the current thread.  The <i>interrupted status</i> of the
             current thread is cleared when this exception is thrown.</DL>
</DD>
</DL>
<HR>

<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Returns a string representation of this thread, including the
 thread's name and priority.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>a string representation of this thread.</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/Thread.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/lang/System.html" title="class in java.lang"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/lang/Throwable.html" title="class in java.lang"><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="Thread.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;<A HREF="#field_summary">FIELD</A>&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;<A HREF="#field_detail">FIELD</A>&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>
