|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfoxtrot.Task
foxtrot.Job
public abstract class Job
A time-consuming task to be executed in the Worker Thread that does not throw checked exceptions.
Users must implement the run() method with the time-consuming code:
Job task = new Job()
{
public Object run()
{
long sum = 0;
for (int i = 0; i < 1000000; ++i)
{
sum += i;
}
return new Integer(sum);
}
};
RuntimeExceptions or Errors thrown by the run() method will be rethrown automatically by
Worker.post(Job) or ConcurrentWorker.post(Job).
Worker,
ConcurrentWorker| Constructor Summary | |
|---|---|
Job()
|
|
| Method Summary | |
|---|---|
abstract java.lang.Object |
run()
The method to implement with time-consuming code. |
| Methods inherited from class foxtrot.Task |
|---|
getResultOrThrow, isCompleted |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Job()
| Method Detail |
|---|
public abstract java.lang.Object run()
run in class Task
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||