public class SimpleThread extends Thread
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
SimpleThread() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alive()
Returns false when the cleanup() method has finished.
|
protected void |
cleanup()
Removes all references to instantiated objects, and changes the thread's
state to "not alive".
|
protected boolean |
dying()
Returns true when the thread is supposed to shut down.
|
void |
kill()
Causes method dying() to return true, letting the thread know it needs to
shut down.
|
void |
restart()
Calls the rerun() method on a seperate thread, which calls run() when the
previous thread finishes.
|
void |
run()
Executes the thread's main loop.
|
protected void |
snooze(long milliseconds)
Sleeps for the specified number of milliseconds.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected void cleanup()
public void run()
public void restart()
public boolean alive()
public void kill()
protected boolean dying()
protected void snooze(long milliseconds)
Copyright © 2017. All rights reserved.