Code example for Collection

Methods: size, toArray

0
     * <p/>The list is empty until a thread update was requested with 
     * {@link Client#requestThreadUpdate()}. 
     */ 
    public synchronized ThreadInfo[] getThreads() { 
        Collection<ThreadInfo> threads = mThreadMap.values();
        return threads.toArray(new ThreadInfo[threads.size()]);
    } 
 
    /** 
     * Returns the {@link ThreadInfo} by thread id. 
     */ 
    synchronized ThreadInfo getThread(int threadId) {
        return mThreadMap.get(threadId);
    } 
 
    synchronized void clearThreads() { 
        mThreadMap.clear();
    } 
 
    /** 
     * Returns the list of {@link NativeAllocationInfo}.