jMobileCore toolkit

com.jmobilecore.thread
Class ThreadControl

java.lang.Object
  extended by com.jmobilecore.thread.ThreadControl

public class ThreadControl
extends java.lang.Object


Field Summary
 AdvThread thread
          The current thread
 
Constructor Summary
ThreadControl(java.lang.Runnable task)
           
ThreadControl(java.lang.Runnable task, int frequency)
           
 
Method Summary
 void destructor()
          Default destructor.
 boolean reset(int frequency, int delay)
          Resets frecuency and delay for the current thread
protected  boolean setTask(java.lang.Runnable task, int frequency)
          Sets the current task and frequency of the task execution
 boolean stop()
          Stops the current thread
 boolean terminate()
          Terminates the current thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thread

public AdvThread thread
The current thread

Constructor Detail

ThreadControl

public ThreadControl(java.lang.Runnable task)

ThreadControl

public ThreadControl(java.lang.Runnable task,
                     int frequency)
Method Detail

destructor

public void destructor()
Default destructor. Helps VM to perform garbage collection


reset

public boolean reset(int frequency,
                     int delay)
Resets frecuency and delay for the current thread

Parameters:
frequency - the frequency of the task execution
delay - the delay before the first task execution
Returns:
true if reset is successful, false otherwise

setTask

protected boolean setTask(java.lang.Runnable task,
                          int frequency)
Sets the current task and frequency of the task execution

Parameters:
task - the new Runnable task
frequency - the frequency of the task execution
Returns:
true if setup is successful, false otherwise

stop

public boolean stop()
Stops the current thread


terminate

public boolean terminate()
Terminates the current thread

Returns:
true if termination is done, false otherwise

jMobileCore toolkit