us.ihmc.utilities.thread
Class TestInterruptableWorker
java.lang.Object
us.ihmc.utilities.thread.InterruptableWorker
us.ihmc.utilities.thread.TestInterruptableWorker
- All Implemented Interfaces:
- java.lang.Runnable
public class TestInterruptableWorker
- extends InterruptableWorker
|
Method Summary |
InterruptableWorker.STATE |
doWork()
This method needs to be overridden and should perform the actual work
It should periodically chech the isInterrupted method to know if it should
stop. |
java.lang.Object |
getCurrentResult()
This method needs to be overridden and should be used by the application
to get the current result while waiting as well as get the final result
once finished |
static void |
main(java.lang.String[] args)
|
void |
reset(int startNumber,
int endNumber,
int countBy)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestInterruptableWorker
public TestInterruptableWorker()
reset
public void reset(int startNumber,
int endNumber,
int countBy)
doWork
public InterruptableWorker.STATE doWork()
- Description copied from class:
InterruptableWorker
- This method needs to be overridden and should perform the actual work
It should periodically chech the isInterrupted method to know if it should
stop. It should return one of the three acceptable finish states:
SUCCESSFULLY_COMPLETED
UNSUCCESSFULLY_COMPLETED
INTERRUPTED
- Specified by:
doWork in class InterruptableWorker
- Returns:
- STATE
getCurrentResult
public java.lang.Object getCurrentResult()
- Description copied from class:
InterruptableWorker
- This method needs to be overridden and should be used by the application
to get the current result while waiting as well as get the final result
once finished
- Specified by:
getCurrentResult in class InterruptableWorker
- Returns:
- Object
main
public static void main(java.lang.String[] args)