ThreadGroup.enumerate

ThreadGroup.enumerate

Class Overview | Class Members | This Package | All Packages

Syntax 1
public int enumerate( Thread list[] )
Parameters
list
an array into which to place the list of threads.
Returns
the number of threads put into the array.
Description
Copies into the specified array every active thread in this thread group and its subgroups.

An application should use the activeCount 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.

See Also
activeCount



Syntax 2
public int enumerate( Thread list[], boolean recurse )
Parameters
list
an array into which to place the list of threads.
recurse
a flag indicating whether also to include threads in thread groups that are subgroups of this thread group.
Returns
the number of threads placed into the array.
Description
Copies into the specified array every active thread in this thread group. If the recurse flag is true, 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.

An application should use the activeCount method to get an estimate of how big the array should be.

See Also
activeCount