public class ThreadCore extends Object implements Runnable
| Constructor and Description |
|---|
ThreadCore()
Creates a new ThreadCore instance.
|
| Modifier and Type | Method and Description |
|---|---|
Thread |
getThreadObject()
Gets the internal Thread object.
|
boolean |
isRunnable()
Checks if the current thread is the same as this ThreadCore's thread.
|
void |
restart()
Restarts the thread by stopping it first and then starting it again.
|
void |
run()
The main execution method of the thread.
|
void |
setThreadObject(Thread obj)
Sets the internal Thread object.
|
void |
start()
Starts the thread if it's not already running.
|
void |
stop()
Stops the thread safely using interruption.
|
public Thread getThreadObject()
public boolean isRunnable()
public void restart()
public void run()
public void setThreadObject(Thread obj)
obj - the Thread object to setpublic void start()
public void stop()