Package samer.tools
Class RThread
- java.lang.Object
-
- Viewable
-
- samer.tools.RThread
-
- All Implemented Interfaces:
- java.lang.Runnable
public class RThread extends Viewable implements java.lang.Runnableframe rate regulator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classRThread.Kill
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcheckpoint()This method blocks if the thread has been paused and throws an InterruptedException if the thread has been killed.voidderegulate()voiddispose()doubleelapsedTime()voidexecute(java.lang.String c, Environment env)doublefps()voidgetCommands(Agent.Registry r)TaskgetTask()ViewergetViewer()voidinterrupt()longiterations()voidjoin()voidkill()Important: this method BLOCKS until the thread co-operatively terminates, either naturally or by not handling the InterruptedException that will be thrown by thecheckpoint()method the next time it is called.TaskonFinish(Task t)voidpause()voidregulate()voidreset()voidrun()voidsetPriority(double p)voidsetRate(double r)voidsetTask(Task t)voidstart()voidstart(int n)voidtock()voidunpause()
-
-
-
Constructor Detail
-
RThread
public RThread()
-
RThread
public RThread(Task r)
-
-
Method Detail
-
getViewer
public Viewer getViewer()
-
dispose
public void dispose()
-
getTask
public Task getTask()
-
setTask
public void setTask(Task t)
-
interrupt
public void interrupt()
-
join
public void join()
-
start
public void start()
-
start
public void start(int n)
-
kill
public void kill()
Important: this method BLOCKS until the thread co-operatively terminates, either naturally or by not handling the InterruptedException that will be thrown by thecheckpoint()method the next time it is called.
-
setPriority
public void setPriority(double p)
-
pause
public void pause()
-
unpause
public void unpause()
-
checkpoint
public final void checkpoint() throws RThread.KillThis method blocks if the thread has been paused and throws an InterruptedException if the thread has been killed.- Throws:
RThread.Kill
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
fps
public double fps()
-
elapsedTime
public double elapsedTime()
-
iterations
public long iterations()
-
setRate
public void setRate(double r)
-
regulate
public void regulate()
-
deregulate
public void deregulate()
-
reset
public void reset()
-
tock
public void tock()
-
getCommands
public void getCommands(Agent.Registry r)
-
execute
public void execute(java.lang.String c, Environment env) throws java.lang.Exception- Throws:
java.lang.Exception
-
-