public class Job extends Object implements Runnable
tasks
that must be executed in a particular order
so that they produce a meaningful computation over an entity system. Examples of a job
might be to render a frame, which could then be decomposed into tasks for computing the
visible objects, occluded objects, the optimal rendering order, and shadow
computations, etc.
Jobs are created by first getting the Scheduler
from a particular EntitySystem,
and then calling Scheduler.createJob(String, Task...)
. The name of a job is
primarily used to for informational purposes and does not affect its behavior.Modifier and Type | Method and Description |
---|---|
String |
getName() |
Scheduler |
getScheduler() |
void |
report(Result r)
Report the given result instance to all tasks yet to be executed by this job, that
have declared a public method named 'report' that takes a Result sub-type that is
compatible with r's type.
|
void |
run()
Invoke all tasks in this job.
|
String |
toString() |
public String getName()
public Scheduler getScheduler()
public void run()
Scheduler
has convenience methods to repeatedly invoke a job, this
method can be called directly if a more controlled job execution scheme is
required.public void report(Result r)
r
- The result to reportNullPointerException
- if r is nullIllegalStateException
- if r is a singleton result whose type has already
been reported by another task in this job, or if the
job is not currently executing tasksCopyright © 2013. All Rights Reserved.