分享
 
 
 

java.lang.ThreadGroup翻译

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

<!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-rc) on Fri Jun 13 00:14:20 PDT 2003 -->

<TITLE>

ThreadGroup (Java 2 Platform SE v1.4.2)

</TITLE>

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

<META NAME="keywords" CONTENT="getName()">

<META NAME="keywords" CONTENT="getParent()">

<META NAME="keywords" CONTENT="getMaxPriority()">

<META NAME="keywords" CONTENT="isDaemon()">

<META NAME="keywords" CONTENT="isDestroyed()">

<META NAME="keywords" CONTENT="setDaemon()">

<META NAME="keywords" CONTENT="setMaxPriority()">

<META NAME="keywords" CONTENT="parentOf()">

<META NAME="keywords" CONTENT="checkAccess()">

<META NAME="keywords" CONTENT="activeCount()">

<META NAME="keywords" CONTENT="enumerate()">

<META NAME="keywords" CONTENT="activeGroupCount()">

<META NAME="keywords" CONTENT="stop()">

<META NAME="keywords" CONTENT="interrupt()">

<META NAME="keywords" CONTENT="suspend()">

<META NAME="keywords" CONTENT="resume()">

<META NAME="keywords" CONTENT="destroy()">

<META NAME="keywords" CONTENT="list()">

<META NAME="keywords" CONTENT="uncaughtException()">

<META NAME="keywords" CONTENT="allowThreadSuspension()">

<META NAME="keywords" CONTENT="toString()">

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

<SCRIPT type="text/javascript">

function windowTitle()

{

parent.document.title="ThreadGroup (Java 2 Platform SE v1.4.2)";

}

</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/ThreadGroup.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-files/index-1.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>

<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.4.2</b></EM>

</TD>

</TR>

<TR>

<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">

&nbsp;<A HREF="../../java/lang/Thread.html" title="class in java.lang"><B>PREV CLASS</B></A>&nbsp;

&nbsp;<A HREF="../../java/lang/ThreadLocal.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="ThreadGroup.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.lang</FONT>

<BR>

Class ThreadGroup</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.ThreadGroup</B>

</PRE>

<HR>

<DL>

<DT>public class <B>ThreadGroup</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>

<P>

A thread group represents a set of threads. In addition, a thread

group can also include other thread groups. The thread groups form

a tree in which every thread group except the initial thread group

has a parent.

ThreadGroup表示一组线程。另外,一个线程组可以包含其他线程组。树形结构中的线程组除了最顶层的都有自己的父线程组。

<p>

A thread is allowed to access information about its own thread

group, but not to access information about its thread group's

parent thread group or any other thread groups.

一个线程可访问其所属的线程组,但无法访问其父线程组或其他线程组。

<P>

<P>

<DL>

<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</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/lang/ThreadGroup.html#ThreadGroup(java.lang.String)">ThreadGroup</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;Constructs a new thread group. 创建一个新线程组。</TD>

</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">

<TD><CODE><B><A HREF="../../java/lang/ThreadGroup.html#ThreadGroup(java.lang.ThreadGroup, java.lang.String)">ThreadGroup</A></B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>&nbsp;parent,

<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;Creates a new thread group. 创建一个新线程组。</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;int</CODE></FONT></TD>

<TD><CODE><B><A HREF="../../java/lang/ThreadGroup.html#activeCount()">activeCount</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an estimate of the number of active threads in this

thread group.返回该线程组中活动线程的估计值。</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/ThreadGroup.html#activeGroupCount()">activeGroupCount</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an estimate of the number of active groups in this

thread group. 返回该线程组中活动组的估计值。</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/ThreadGroup.html#allowThreadSuspension(boolean)">allowThreadSuspension</A></B>(boolean&nbsp;b)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>The definition of this call depends on <A HREF="../../java/lang/ThreadGroup.html#suspend()"><CODE>suspend()</CODE></A>,

which is deprecated. Further, the behavior of this call

was never specified. 该调用的定义依赖于suspend()(已不支持),而且,该调用的行为从未指定。</I></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/ThreadGroup.html#checkAccess()">checkAccess</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if the currently running thread has permission to

modify this thread group. 确定当前运行县城是否允许修改该线程组。</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/ThreadGroup.html#destroy()">destroy</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Destroys this thread group and all of its subgroups.

销毁该线程组及其所有子线程组。</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/ThreadGroup.html#enumerate(java.lang.Thread[])">enumerate</A></B>(<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A>[]&nbsp;list)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copies into the specified array every active thread in this

thread group and its subgroups.

将该线程组及其子线程组中的所有活动线程拷贝到指定数组中。</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/ThreadGroup.html#enumerate(java.lang.Thread[], boolean)">enumerate</A></B>(<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A>[]&nbsp;list,

boolean&nbsp;recurse)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copies into the specified array every active thread in this

thread group.将该线程组中的所有活动线程拷贝到指定数组中。</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/ThreadGroup.html#enumerate(java.lang.ThreadGroup[])">enumerate</A></B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>[]&nbsp;list)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copies into the specified array references to every active

subgroup in this thread group.

将该线程组中的所有活动子线程组拷贝到指定数组中。</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/ThreadGroup.html#enumerate(java.lang.ThreadGroup[], boolean)">enumerate</A></B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>[]&nbsp;list,

boolean&nbsp;recurse)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copies into the specified array references to every active

subgroup in this thread group.

将该线程组中的所有活动子线程组拷贝到指定数组中。</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/ThreadGroup.html#getMaxPriority()">getMaxPriority</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum priority of this thread group.

返回该线程组的最高优先级。</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/ThreadGroup.html#getName()">getName</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of this thread group.

返回该线程组名称。</TD>

</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">

<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

<CODE>&nbsp;<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A></CODE></FONT></TD>

<TD><CODE><B><A HREF="../../java/lang/ThreadGroup.html#getParent()">getParent</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the parent of this thread group.

返回该线程组的父线程组。</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/ThreadGroup.html#interrupt()">interrupt</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupts all threads in this thread group.

中断该线程组的所有线程。</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/ThreadGroup.html#isDaemon()">isDaemon</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if this thread group is a daemon thread group.

判断该线程组是否是守护线程组。</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/ThreadGroup.html#isDestroyed()">isDestroyed</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if this thread group has been destroyed.

判断该线程组是否被销毁。</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/ThreadGroup.html#list()">list</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prints information about this thread group to the standard

output. 在标准输出中打印该线程组信息。</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/ThreadGroup.html#parentOf(java.lang.ThreadGroup)">parentOf</A></B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>&nbsp;g)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if this thread group is either the thread group

argument or one of its ancestor thread groups.

判断该线程组是否是threadGroup参数本身或者它的祖先线程组。</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/ThreadGroup.html#resume()">resume</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>This method is used solely in conjunction with

<tt>Thread.suspend</tt> and <tt>ThreadGroup.suspend</tt>,

both of which have been deprecated, as they are inherently

deadlock-prone. See <A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A> for details.

该方法仅和Thread.suspend和ThreadGroup.suspend联合使用,但它们均已不推荐使用,因为容易造成死锁。详情查看Thread.suspend()。</I></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/ThreadGroup.html#setDaemon(boolean)">setDaemon</A></B>(boolean&nbsp;daemon)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changes the daemon status of this thread group.

改变该线程组的守护状态。</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/ThreadGroup.html#setMaxPriority(int)">setMaxPriority</A></B>(int&nbsp;pri)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the maximum priority of the group.

设置该线程组的最大优先级。</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/ThreadGroup.html#stop()">stop</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>This method is inherently unsafe. See

<A HREF="../../java/lang/Thread.html#stop()"><CODE>Thread.stop()</CODE></A> for details.

该方法本质上不安全。详情查看Thread.stop()。</I></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/ThreadGroup.html#suspend()">suspend</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>This method is inherently deadlock-prone. See

<A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A> for details.

该方法本质上不安全。详情查看Thread.suspend()。</I></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/ThreadGroup.html#toString()">toString</A></B>()</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string representation of this Thread group.

返回该线程组的字符串形式。</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/ThreadGroup.html#uncaughtException(java.lang.Thread, java.lang.Throwable)">uncaughtException</A></B>(<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A>&nbsp;t,

<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A>&nbsp;e)</CODE>

<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called by the Java Virtual Machine when a thread in this

thread group stops because of an uncaught exception.

当该线程组中某线程因为无法捕获的异常而停止时,Java虚拟机调用该方法。</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#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</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 =========== -->

<!-- ========= 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="ThreadGroup(java.lang.String)"><!-- --></A><H3>

ThreadGroup</H3>

<PRE>

public <B>ThreadGroup</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</PRE>

<DL>

<DD>Constructs a new thread group. The parent of this new group is

the thread group of the currently running thread.

创建一个新线程组。新线程组的父线程组即当前运行线程的线程组。

The <code>checkAccess</code> method of the parent thread group is

called with no arguments; this may result in a security exception.

调用父线程组的无参数的checkAccess方法,这可能导致安全异常。

<P>

<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the new thread group. 新线程组的名称。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread cannot create a

thread in the specified thread group.

当前线程不能在指定线程组中创建线程时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

<HR>

<A NAME="ThreadGroup(java.lang.ThreadGroup, java.lang.String)"><!-- --></A><H3>

ThreadGroup</H3>

<PRE>

public <B>ThreadGroup</B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>&nbsp;parent,

<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</PRE>

<DL>

<DD>Creates a new thread group. The parent of this new group is the

specified thread group.

创建一个新线程组。新线程组的父线程组即当前运行线程的线程组。

<p>

The <code>checkAccess</code> method of the parent thread group is

called with no arguments; this may result in a security exception.

调用父线程组的无参数的checkAccess方法,这可能导致安全异常。

<P>

<DT><B>Parameters:</B><DD><CODE>parent</CODE> - the parent thread group. 父线程组。<DD><CODE>name</CODE> - the name of the new thread group.

新线程组的名称。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if the thread group argument is

<code>null</code>. 线程组参数为null时抛出。

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread cannot create a

thread in the specified thread group. 当前线程不能在指定线程组中创建线程时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</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="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 the name of this thread group. 返回该线程组名称。

<P>

<DD><DL>

<DT><B>Returns:</B><DD>the name of this thread group. 该线程组名称。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="getParent()"><!-- --></A><H3>

getParent</H3>

<PRE>

public final <A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A> <B>getParent</B>()</PRE>

<DL>

<DD>Returns the parent of this thread group. 返回该线程组的父线程组。

<p>

First, if the parent is not <code>null</code>, the

<code>checkAccess</code> method of the parent thread group is

called with no arguments; this may result in a security exception.

如果parent不为null,先调用父线程组的无参数的checkAccess方法,这可能导致安全异常。

<P>

<DD><DL>

<DT><B>Returns:</B><DD>the parent of this thread group. The top-level thread group

is the only thread group whose parent is <code>null</code>. 该线程组的父线程组。顶层线程组的父线程组为null。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread cannot modify

this thread group. 当前线程不能修改该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A>,

<A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/RuntimePermission.html" title="class in java.lang"><CODE>RuntimePermission</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="getMaxPriority()"><!-- --></A><H3>

getMaxPriority</H3>

<PRE>

public final int <B>getMaxPriority</B>()</PRE>

<DL>

<DD>Returns the maximum priority of this thread group. Threads that are

part of this group cannot have a higher priority than the maximum

priority.

返回该线程组的最高优先级。该线程组中线程的优先级不可能比其高。

<P>

<DD><DL>

<DT><B>Returns:</B><DD>the maximum priority that a thread in this thread group

can have. 线程组中线程所能拥有的最高优先级。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#setMaxPriority(int)"><CODE>setMaxPriority(int)</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="isDaemon()"><!-- --></A><H3>

isDaemon</H3>

<PRE>

public final boolean <B>isDaemon</B>()</PRE>

<DL>

<DD>Tests if this thread group is a daemon thread group. A

daemon thread group is automatically destroyed when its last

thread is stopped or its last thread group is destroyed.

判断该线程组是否是守护线程组。守护线程组中最后一个线程停止运行或最后一个线程组被销毁,守护线程组也

自动销毁。

<P>

<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if this thread group is a daemon thread group;

<code>false</code> otherwise. 如果该线程组是守护线程组,返回true,否则false。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="isDestroyed()"><!-- --></A><H3>

isDestroyed</H3>

<PRE>

public boolean <B>isDestroyed</B>()</PRE>

<DL>

<DD>Tests if this thread group has been destroyed. 判断该线程组是否被销毁。

<P>

<DD><DL>

<DT><B>Returns:</B><DD>true if this object is destroyed 如果该对象被销毁,返回true<DT><B>Since:</B></DT>

<DD>JDK1.1</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="setDaemon(boolean)"><!-- --></A><H3>

setDaemon</H3>

<PRE>

public final void <B>setDaemon</B>(boolean&nbsp;daemon)</PRE>

<DL>

<DD>Changes the daemon status of this thread group.

改变该线程组的守护状态。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

A daemon thread group is automatically destroyed when its last

thread is stopped or its last thread group is destroyed.

守护线程组中最后一个线程停止运行或最后一个线程组被销毁,守护线程组也

自动销毁。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>daemon</CODE> - if <code>true</code>, marks this thread group as

a daemon thread group; otherwise, marks this

thread group as normal.

如果为true,将该线程组标记为守护线程组,否则标记为普通线程。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread cannot modify

this thread group. 当前线程不能修改该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="setMaxPriority(int)"><!-- --></A><H3>

setMaxPriority</H3>

<PRE>

public final void <B>setMaxPriority</B>(int&nbsp;pri)</PRE>

<DL>

<DD>Sets the maximum priority of the group. Threads in the thread

group that already have a higher priority are not affected.

设置该线程组的最大优先级。如果线程组中某些线程的优先级更高,则不受影响。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

If the <code>pri</code> argument is less than

<A HREF="../../java/lang/Thread.html#MIN_PRIORITY"><CODE>Thread.MIN_PRIORITY</CODE></A> or greater than

<A HREF="../../java/lang/Thread.html#MAX_PRIORITY"><CODE>Thread.MAX_PRIORITY</CODE></A>, the maximum priority of the group

remains unchanged.

如果pri参数小于Thread.MIN_PRIORITY或着大于Thread.MAX_PRIORITY,该线程组的优先级保持不变。

<p>

Otherwise, the priority of this ThreadGroup object is set to the

smaller of the specified <code>pri</code> and the maximum permitted

priority of the parent of this thread group. (If this thread group

is the system thread group, which has no parent, then its maximum

priority is simply set to <code>pri</code>.) Then this method is

called recursively, with <code>pri</code> as its argument, for

every thread group that belongs to this thread group.

否则,线程组的优先级被设为指定的pri和该线程组的父线程组所允许的最大优先级中的较小值。

(如果该线程组是系统线程组,没有父线程组,那么最大优先级简单地设为pri)而且该方法对

属于该线程组的每个线程组都以pri作为参数递归调用。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>pri</CODE> - the new priority of the thread group. 线程组的新优先级

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread cannot modify

this thread group. 当前线程不能修改该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#getMaxPriority()"><CODE>getMaxPriority()</CODE></A>,

<A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="parentOf(java.lang.ThreadGroup)"><!-- --></A><H3>

parentOf</H3>

<PRE>

public final boolean <B>parentOf</B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>&nbsp;g)</PRE>

<DL>

<DD>Tests if this thread group is either the thread group

argument or one of its ancestor thread groups.

判断该线程组是否是threadGroup参数本身或者它的祖先线程组。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>g</CODE> - a thread group. 线程组。

<DT><B>Returns:</B><DD><code>true</code> if this thread group is the thread group

argument or one of its ancestor thread groups;

<code>false</code> otherwise.

如果该线程组是threadGroup参数本身或者它的祖先线程组,返回true,否则为false。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="checkAccess()"><!-- --></A><H3>

checkAccess</H3>

<PRE>

public final void <B>checkAccess</B>()</PRE>

<DL>

<DD>Determines if the currently running thread has permission to

modify this thread group.

确定当前运行县城是否允许修改该线程组。

<p>

If there is a security manager, its <code>checkAccess</code> method

is called with this thread group as its argument. This may result

in throwing a <code>SecurityException</code>.

如果存在安全管理器,以该线程组作参数调用它的的checkAccess方法,这可能导致抛出安全SecurityException。

<P>

<DD><DL>

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread is not allowed to

access this thread group.当前线程不能访问该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/SecurityManager.html#checkAccess(java.lang.ThreadGroup)"><CODE>SecurityManager.checkAccess(java.lang.ThreadGroup)</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="activeCount()"><!-- --></A><H3>

activeCount</H3>

<PRE>

public int <B>activeCount</B>()</PRE>

<DL>

<DD>Returns an estimate of the number of active threads in this

thread group.

返回该线程组中活动线程的估计值。

<P>

<DD><DL>

<DT><B>Returns:</B><DD>the number of active threads in this thread group and in any

other thread group that has this thread group as an ancestor. 当前线程组以及所有以其为祖先的线程组中

所包含的活动线程估计值。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="enumerate(java.lang.Thread[])"><!-- --></A><H3>

enumerate</H3>

<PRE>

public int <B>enumerate</B>(<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A>[]&nbsp;list)</PRE>

<DL>

<DD>Copies into the specified array every active thread in this

thread group and its subgroups. 将该线程组及其子线程组中的所有活动线程拷贝到指定数组中。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

An application should use the <code>activeCount</code> method to

get an estimate of how big the array should be. If the array is

too short to hold all the threads, the extra threads are silently

ignored.

应用程序应该使用activeCount方法来获取该数组大小的估计值。如果数组过小以至于不能容纳所有的线程,

多余的线程会被忽略。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>list</CODE> - an array into which to place the list of threads. 用来放置线程集的数组。

<DT><B>Returns:</B><DD>the number of threads put into the array. 放入数组的线程数。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread does not

have permission to enumerate this thread group.

当前线程不允许统计该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#activeCount()"><CODE>activeCount()</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="enumerate(java.lang.Thread[], boolean)"><!-- --></A><H3>

enumerate</H3>

<PRE>

public int <B>enumerate</B>(<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A>[]&nbsp;list,

boolean&nbsp;recurse)</PRE>

<DL>

<DD>Copies into the specified array every active thread in this

thread group. If the <code>recurse</code> flag is

<code>true</code>, references to every active thread in this

thread's subgroups are also included. If the array is too short to

hold all the threads, the extra threads are silently ignored.

将该线程组中的所有活动线程拷贝到指定数组中。如果recurse标记为true,将包括

该线程的子组中每个活动线程。如果数组过小以至于不能容纳所有的线程,

多余的线程会被忽略。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

An application should use the <code>activeCount</code> method to

get an estimate of how big the array should be.

应用程序应该使用activeCount方法来获取该数组大小的估计值。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>list</CODE> - an array into which to place the list of threads.

用来放置线程集的数组。<DD><CODE>recurse</CODE> - a flag indicating whether also to include threads

in thread groups that are subgroups of this

thread group. 标记,表示是否包括该线程组的子组的线程。

<DT><B>Returns:</B><DD>the number of threads placed into the array. 放入数组的线程数。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread does not

have permission to enumerate this thread group.

当前线程不允许统计该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#activeCount()"><CODE>activeCount()</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="activeGroupCount()"><!-- --></A><H3>

activeGroupCount</H3>

<PRE>

public int <B>activeGroupCount</B>()</PRE>

<DL>

<DD>Returns an estimate of the number of active groups in this

thread group. 返回该线程组中活动组的估计值。

<P>

<DD><DL>

<DT><B>Returns:</B><DD>the number of active thread groups with this thread group as

an ancestor.以该线程组为祖先的活动组的估计值。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="enumerate(java.lang.ThreadGroup[])"><!-- --></A><H3>

enumerate</H3>

<PRE>

public int <B>enumerate</B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>[]&nbsp;list)</PRE>

<DL>

<DD>Copies into the specified array references to every active

subgroup in this thread group. 将该线程组中的所有活动子线程组拷贝到指定数组中。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

An application should use the <code>activeGroupCount</code>

method to get an estimate of how big the array should be. If the

array is too short to hold all the thread groups, the extra thread

groups are silently ignored.

应用程序应该使用activeCount方法来获取该数组大小的估计值。如果数组过小以至于不能容纳所有的线程,

多余的线程会被忽略。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>list</CODE> - an array into which to place the list of thread groups.

用来放置线程组集的数组。

<DT><B>Returns:</B><DD>the number of thread groups put into the array. 放入数组的线程组数。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread does not

have permission to enumerate this thread group.

当前线程不允许统计该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#activeGroupCount()"><CODE>activeGroupCount()</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="enumerate(java.lang.ThreadGroup[], boolean)"><!-- --></A><H3>

enumerate</H3>

<PRE>

public int <B>enumerate</B>(<A HREF="../../java/lang/ThreadGroup.html" title="class in java.lang">ThreadGroup</A>[]&nbsp;list,

boolean&nbsp;recurse)</PRE>

<DL>

<DD>Copies into the specified array references to every active

subgroup in this thread group. If the <code>recurse</code> flag is

<code>true</code>, references to all active subgroups of the

subgroups and so forth are also included.

将该线程组中的所有活动子线程组拷贝到指定数组中。如果recurse标记为true,将包括

该线程的子组中每个活动线程组。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

An application should use the <code>activeGroupCount</code>

method to get an estimate of how big the array should be.

应用程序应该使用activeCount方法来获取该数组大小的估计值。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>list</CODE> - an array into which to place the list of threads.

用来放置线程集的数组。<DD><CODE>recurse</CODE> - a flag indicating whether to recursively enumerate

all included thread groups. 标记,表示是否递归统计所有被包括的线程组。

<DT><B>Returns:</B><DD>the number of thread groups put into the array. 放入数组的线程数。

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread does not

have permission to enumerate this thread group.

当前线程不允许统计该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#activeGroupCount()"><CODE>activeGroupCount()</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="stop()"><!-- --></A><H3>

stop</H3>

<PRE>

public final void <B>stop</B>()</PRE>

<DL>

<DD><B>Deprecated.</B>&nbsp;<I>This method is inherently unsafe. See

<A HREF="../../java/lang/Thread.html#stop()"><CODE>Thread.stop()</CODE></A> for details.

该方法本质上不安全。详情查看Thread.stop()。</I>

<P>

<DD>Stops all threads in this thread group.

停止该线程组中的所有线程。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

This method then calls the <code>stop</code> method on all the

threads in this thread group and in all of its subgroups.

该方法调用该线程组和它的所有子线程组中所有线程的stop方法。

<P>

<DD><DL>

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread is not allowed

to access this thread group or any of the threads in

the thread group.当前线程不允许访问该线程组或者线程组中的其他线程时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/Thread.html#stop()"><CODE>Thread.stop()</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="interrupt()"><!-- --></A><H3>

interrupt</H3>

<PRE>

public final void <B>interrupt</B>()</PRE>

<DL>

<DD>Interrupts all threads in this thread group.

中断该线程组中的所有线程。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

This method then calls the <code>interrupt</code> method on all the

threads in this thread group and in all of its subgroups.

该方法调用该线程组和它的所有子线程组中所有线程的interrupt方法。

<P>

<DD><DL>

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread is not allowed

to access this thread group or any of the threads in

the thread group.当前线程不允许访问该线程组或者线程组中的其他线程时抛出。<DT><B>Since:</B></DT>

<DD>1.2</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html#interrupt()"><CODE>Thread.interrupt()</CODE></A>,

<A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="suspend()"><!-- --></A><H3>

suspend</H3>

<PRE>

public final void <B>suspend</B>()</PRE>

<DL>

<DD><B>Deprecated.</B>&nbsp;<I>This method is inherently deadlock-prone. See

<A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A> for details.

该方法本质上不安全。详情查看Thread.suspend()。</I>

<P>

<DD>Suspends all threads in this thread group.

挂起该线程组中的所有线程。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

This method then calls the <code>suspend</code> method on all the

threads in this thread group and in all of its subgroups.

该方法调用该线程组和它的所有子线程组中所有线程的suspend方法。

<P>

<DD><DL>

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread is not allowed

to access this thread group or any of the threads in

the thread group.如果当前线程不允许访问该线程组或者线程组中的其他线程时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A>,

<A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="resume()"><!-- --></A><H3>

resume</H3>

<PRE>

public final void <B>resume</B>()</PRE>

<DL>

<DD><B>Deprecated.</B>&nbsp;<I>This method is used solely in conjunction with

<tt>Thread.suspend</tt> and <tt>ThreadGroup.suspend</tt>,

both of which have been deprecated, as they are inherently

deadlock-prone. See <A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A> for details.

该方法仅和Thread.suspend和ThreadGroup.suspend联合使用,但它们均已不推荐使用,因为容易造成死锁。详情查看Thread.suspend()。</I>

<P>

<DD>Resumes all threads in this thread group.

恢复该线程组中的所有线程。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<p>

This method then calls the <code>resume</code> method on all the

threads in this thread group and in all of its sub groups.

该方法调用该线程组和它的所有子线程组中所有线程的resume方法。

<P>

<DD><DL>

<DT><B>Throws:</B>

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread is not allowed to

access this thread group or any of the threads in the

thread group.如果当前线程不允许访问该线程组或者线程组中的线程时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/SecurityException.html" title="class in java.lang"><CODE>SecurityException</CODE></A>,

<A HREF="../../java/lang/Thread.html#resume()"><CODE>Thread.resume()</CODE></A>,

<A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="destroy()"><!-- --></A><H3>

destroy</H3>

<PRE>

public final void <B>destroy</B>()</PRE>

<DL>

<DD>Destroys this thread group and all of its subgroups. This thread

group must be empty, indicating that all threads that had been in

this thread group have since stopped.

销毁该线程组及其所有子线程组。

<p>

First, the <code>checkAccess</code> method of this thread group is

called with no arguments; this may result in a security exception.

首先调用该线程组的无参数的checkAccess方法,这可能导致安全异常。

<P>

<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 group is not

empty or if the thread group has already been destroyed. 如果该线程不为空或者已经被销毁时抛出。

<DD><CODE><A HREF="../../java/lang/SecurityException.html" title="class in java.lang">SecurityException</A></CODE> - if the current thread cannot modify this

thread group. 当前线程不能修改该线程组时抛出。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="list()"><!-- --></A><H3>

list</H3>

<PRE>

public void <B>list</B>()</PRE>

<DL>

<DD>Prints information about this thread group to the standard

output. This method is useful only for debugging.

在标准输出中打印该线程组信息。该方法仅用来调试。

<P>

<DD><DL>

<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</DL>

</DD>

</DL>

<HR>

<A NAME="uncaughtException(java.lang.Thread, java.lang.Throwable)"><!-- --></A><H3>

uncaughtException</H3>

<PRE>

public void <B>uncaughtException</B>(<A HREF="../../java/lang/Thread.html" title="class in java.lang">Thread</A>&nbsp;t,

<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A>&nbsp;e)</PRE>

<DL>

<DD>Called by the Java Virtual Machine when a thread in this

thread group stops because of an uncaught exception.

当该线程组中某线程因为无法捕获的异常而停止时,Java虚拟机调用该方法。

<p>

The <code>uncaughtException</code> method of

<code>ThreadGroup</code> does the following:

ThreadGroup的uncaughtException方法按以下进行:

<ul>

<li>If this thread group has a parent thread group, the

<code>uncaughtException</code> method of that parent is called

with the same two arguments.

如果该线程组有父线程组,以相同的两个参数调用父线程组的uncaughtException方法。

<li>Otherwise, this method determines if the <code>Throwable</code>

argument is an instance of <code>ThreadDeath</code>. If so, nothing

special is done. Otherwise, the <code>Throwable</code>'s

<code>printStackTrace</code> method is called to print a stack

backtrace to the standard error stream.

否则,该方法确定Throwable参数是否是ThreadDeath的实例,如果是,什么也不做,

否则,调用Throwable的printStackTrace方法在标准错误流中打印堆栈信息。

</ul>

<p>

Applications can override this method in subclasses of

<code>ThreadGroup</code> to provide alternative handling of

uncaught exceptions.

应用程序应当在ThreadGroup的子类中覆盖该方法,以使未捕获异常的处理方式可选。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>t</CODE> - the thread that is about to exit.

将要退出的线程。<DD><CODE>e</CODE> - the uncaught exception. 未捕获的异常。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

<DT><B>See Also:</B><DD><A HREF="../../java/lang/System.html#err"><CODE>System.err</CODE></A>,

<A HREF="../../java/lang/ThreadDeath.html" title="class in java.lang"><CODE>ThreadDeath</CODE></A>,

<A HREF="../../java/lang/Throwable.html#printStackTrace(java.io.PrintStream)"><CODE>Throwable.printStackTrace(java.io.PrintStream)</CODE></A></DL>

</DD>

</DL>

<HR>

<A NAME="allowThreadSuspension(boolean)"><!-- --></A><H3>

allowThreadSuspension</H3>

<PRE>

public boolean <B>allowThreadSuspension</B>(boolean&nbsp;b)</PRE>

<DL>

<DD><B>Deprecated.</B>&nbsp;<I>The definition of this call depends on <A HREF="../../java/lang/ThreadGroup.html#suspend()"><CODE>suspend()</CODE></A>,

which is deprecated. Further, the behavior of this call

was never specified. 该调用的定义依赖于suspend()(已不支持),而且,该调用的行为从未指定。</I>

<P>

<DD>Used by VM to control lowmem implicit suspension.VM用来控制低内存(?)隐式挂起。

<P>

<DD><DL>

<DT><B>Parameters:</B><DD><CODE>b</CODE> - boolean to allow or disallow suspension 是否允许拒绝挂起

<DT><B>Returns:</B><DD>true on success 成功为true<DT><B>Since:</B></DT>

<DD>JDK1.1</DD>

</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 group.

返回该线程组的字符串形式。

<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 group. 该线程组的字符串形式。<DT><B>Since:</B></DT>

<DD>JDK1.0</DD>

</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/ThreadGroup.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-files/index-1.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>

<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.4.2</b></EM>

</TD>

</TR>

<TR>

<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">

&nbsp;<A HREF="../../java/lang/Thread.html" title="class in java.lang"><B>PREV CLASS</B></A>&nbsp;

&nbsp;<A HREF="../../java/lang/ThreadLocal.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="ThreadGroup.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="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>

</BODY>

</HTML>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有