ThreadGroupEx.enumerate

Copies into the specified array references to every active subgroup in this thread group. If {@code recurse} is {@code true}, this method recursively enumerates all subgroups of this thread group and references to every active thread group in these subgroups are also included.

<p> An application might use the {@linkplain #activeGroupCount activeGroupCount} method to get an estimate of how big the array should be, however <i>if the array is too short to hold all the thread groups, the extra thread groups are silently ignored.</i> If it is critical to obtain every active subgroup in this thread group, the caller should verify that the returned int value is strictly less than the length of {@code list}.

<p> Due to the inherent race condition in this method, it is recommended that the method only be used for debugging and monitoring purposes.

@param list an array into which to put the list of thread groups

@param recurse if {@code true}, recursively enumerate all subgroups

@return the number of thread groups put into the array

@throws SecurityException if {@linkplain #checkAccess checkAccess} determines that the current thread cannot access this thread group

  1. int enumerate(Thread[] list)
  2. int enumerate(Thread[] list, bool recurse)
  3. int enumerate(ThreadGroupEx[] list)
  4. int enumerate(ThreadGroupEx[] list, bool recurse)
    class ThreadGroupEx
    int
    enumerate

Meta