Example usage for Java java.lang Thread fields, constructors, methods, implement or subclass
The text is from its open source code.
int | MIN_PRIORITY The minimum priority that a thread can have. |
int | NORM_PRIORITY The default priority that is assigned to a thread. |
int | MAX_PRIORITY The maximum priority that a thread can have. |
Thread(Runnable target) Allocates a new Thread object. | |
Thread(String name) Allocates a new Thread object. | |
Thread() Allocates a new Thread object. | |
Thread(Runnable target, AccessControlContext acc) Creates a new Thread that inherits the given AccessControlContext but thread-local variables are not inherited. | |
Thread(ThreadGroup group, Runnable target) Allocates a new Thread object. | |
Thread(ThreadGroup group, String name) Allocates a new Thread object. | |
Thread(Runnable target, String name) Allocates a new Thread object. | |
Thread(ThreadGroup group, Runnable target, String name) Allocates a new Thread object so that it has target as its run object, has the specified name as its name, and belongs to the thread group referred to by group . |
int | activeCount() Returns an estimate of the number of active threads in the current thread's java.lang.ThreadGroup thread group and its subgroups. |
void | checkAccess() Determines if the currently running thread has permission to modify this thread. |
Thread | currentThread() Returns a reference to the currently executing thread object. |
void | dumpStack() Prints a stack trace of the current thread to the standard error stream. |
int | enumerate(Thread tarray[]) Copies into the specified array every active thread in the current thread's thread group and its subgroups. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
Map | getAllStackTraces() Returns a map of stack traces for all live threads. |
Class> | getClass() Returns the runtime class of this Object . |
ClassLoader | getContextClassLoader() Returns the context ClassLoader for this thread. |
UncaughtExceptionHandler | getDefaultUncaughtExceptionHandler() Returns the default handler invoked when a thread abruptly terminates due to an uncaught exception. |
long | getId() Returns the identifier of this Thread. |
String | getName() Returns this thread's name. |
int | getPriority() Returns this thread's priority. |
StackTraceElement[] | getStackTrace() Returns an array of stack trace elements representing the stack dump of this thread. |
State | getState() Returns the state of this thread. |
ThreadGroup | getThreadGroup() Returns the thread group to which this thread belongs. |
UncaughtExceptionHandler | getUncaughtExceptionHandler() Returns the handler invoked when this thread abruptly terminates due to an uncaught exception. |
int | hashCode() Returns a hash code value for the object. |
boolean | holdsLock(Object obj) Returns true if and only if the current thread holds the monitor lock on the specified object. |
void | interrupt() Interrupts this thread. |
boolean | interrupted() Tests whether the current thread has been interrupted. |
boolean | isAlive() Tests if this thread is alive. |
boolean | isDaemon() Tests if this thread is a daemon thread. |
boolean | isInterrupted() Tests whether this thread has been interrupted. |
void | join() Waits for this thread to die. |
void | join(long millis, int nanos) Waits at most millis milliseconds plus nanos nanoseconds for this thread to die. |
void | join(final long millis) Waits at most millis milliseconds for this thread to die. |
void | notify() Wakes up a single thread that is waiting on this object's monitor. |
void | notifyAll() Wakes up all threads that are waiting on this object's monitor. |
void | resume() Resumes a suspended thread. |
void | run() If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns. |
void | setContextClassLoader(ClassLoader cl) Sets the context ClassLoader for this Thread. |
void | setDaemon(boolean on) Marks this thread as either a #isDaemon daemon thread or a user thread. |
void | setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh) Set the default handler invoked when a thread abruptly terminates due to an uncaught exception, and no other handler has been defined for that thread. |
void | setName(String name) Changes the name of this thread to be equal to the argument name . |
void | setPriority(int newPriority) Changes the priority of this thread. |
void | setUncaughtExceptionHandler(UncaughtExceptionHandler eh) Set the handler invoked when this thread abruptly terminates due to an uncaught exception. |
void | sleep(long millis) Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds, subject to the precision and accuracy of system timers and schedulers. |
void | start() Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread. |
void | stop() Forces the thread to stop executing. |
void | suspend() Suspends this thread. |
String | toString() Returns a string representation of this thread, including the thread's name, priority, and thread group. |
void | wait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
void | wait() Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
void | yield() A hint to the scheduler that the current thread is willing to yield its current use of a processor. |