Thread Class

Purpose:

Allows multithreaded Java programming.

Mechanics:

The following are the methods in the Thread class.
public class Thread implements Runnable { 
     public final static int MIN_PRIORITY = 1; 
     public final static int MAX_PRIORITY = 10; 
     public final static int NORM_PRIORITY = 5; 
     public Thread(); 
     public Thread(String name); 
     public Thread(Runnable runObject); 
     public Thread(Runnable runObject, String name); 
     public Thread(ThreadGroup group, String name) 
        throws SecurityException, IllegalThreadStateException; 
     public Thread(ThreadGroup group, Runnable runObject) 
        throws SecurityException, IllegalThreadStateException; 
     public Thread(ThreadGroup group, Runnable runObject, String name) 
        throws SecurityException, IllegalThreadStateException; 
     public String toString(); 
     public void checkAccess() 
        throws SecurityException; 
     public void run(); 
     public void start() 
        throws IllegalThreadStateException; 
     public final void stop() 
        throws SecurityException; 
     public final void stop(Throwable thr) 
        throws SecurityException, NullPointerException; 
     public final void suspend() 
        throws SecurityException; 
     public final void resume() 
        throws SecurityException; 
     public final String getName(); 
     public final void setName(String name) 
        throws SecurityException; 
     public final ThreadGroup getThreadGroup(); 
     public final int getPriority();
     public final void setPriority(int newPriority) 
        throws SecurityException, IllegalArgumentException; 
     public final boolean isDaemon(); 
     public final void setDaemon(boolean on) 
        throws SecurityException, IllegalThreadStateException; 
     public final boolean isAlive(); 
     public int countStackFrames(); 
     public final void join() 
        throws InterruptedException; 
     public final void join(long millis) 
        throws InterruptedException; 
     public final void join(long millis, int nanos) 
        throws InterruptedException; 
     public void interrupt(); 
     public boolean isInterrupted(); 
     public static boolean interrupted(); 
     public static Thread currentThread(); 
     public static int activeCount(); // deprecated 
     public static int enumerate(Thread tarray[]); // deprecated 
     public static void dumpStack(); 
     public static void yield(); 
     public static void sleep(long millis) 
        throws InterruptedException; 
     public static void sleep(long millis, int nanos) 
        throws InterruptedException; 
     public void destroy(); 
}

Back to the Table of Contents
email suggestions to: cs015tas@cs.brown.edu