📄 thread.html
字号:
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<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.</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.</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.</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<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.<DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../java/lang/Runnable.html"><CODE>Runnable</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="Thread(java.lang.Runnable)"><!-- --></A><H3>
Thread</H3>
<PRE>
public <B>Thread</B>(<A HREF="../../java/lang/Runnable.html">Runnable</A> target)</PRE>
<DL>
<DD>Allocates a new <code>Thread</code> object with a specific target object whose <code>run</code> method is called.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>target</CODE> - the object whose <code>run</code> method is called.</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<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">Thread</A> <B>currentThread</B>()</PRE>
<DL>
<DD>Returns a reference to the currently executing thread object.<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.<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="sleep(long)"><!-- --></A><H3>
sleep</H3>
<PRE>
public static void <B>sleep</B>(long millis) throws <A HREF="../../java/lang/InterruptedException.html">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.<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">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).<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalThreadStateException.html">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.<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">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="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.<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 newPriority)</PRE>
<DL>
<DD>Changes the priority of this thread.<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">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#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.<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>,
<A HREF="../../java/lang/Thread.html#setPriority(int)"><CODE>setPriority(int)</CODE></A></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 VM.<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">InterruptedException</A></PRE>
<DL>
<DD>Waits for this thread to die.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/InterruptedException.html">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">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Returns a string representation of this thread, including a unique number that identifies the thread and the thread's priority.<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">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 NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Thread.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/System.html"><B>PREV CLASS</B></A>
<A HREF="../../java/lang/Throwable.html"><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>
<A HREF="Thread.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID 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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -