org.encog.util.concurrency.job
public abstract class ConcurrentJob extends Object implements Runnable, MultiThreadable
Constructor and Description |
---|
ConcurrentJob(StatusReportable report)
Construct a concurrent job.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getShouldStop() |
int |
getThreadCount() |
boolean |
isRunning() |
abstract int |
loadWorkload()
Load the subtasks.
|
abstract void |
performJobUnit(JobUnitContext context)
Perform one job unit.
|
void |
process()
Process the job.
|
void |
processBackground() |
void |
reportStatus(JobUnitContext context,
String status)
Report the status for this job.
|
abstract Object |
requestNextTask()
Request the next task to be processed.
|
void |
run() |
void |
setReport(StatusReportable r) |
void |
setThreadCount(int numThreads)
Set the number of threads to use.
|
void |
stop()
Request the process to stop.
|
public ConcurrentJob(StatusReportable report)
report
- The object to report status to.public abstract int loadWorkload()
public abstract void performJobUnit(JobUnitContext context)
context
- The context for the job unit.public void process()
public void processBackground()
public void reportStatus(JobUnitContext context, String status)
context
- The job context.status
- The status to report.public abstract Object requestNextTask()
public boolean getShouldStop()
public void stop()
public boolean isRunning()
public void setReport(StatusReportable r)
public int getThreadCount()
getThreadCount
in interface MultiThreadable
public void setThreadCount(int numThreads)
setThreadCount
in interface MultiThreadable
numThreads
- The number of threads to use, or zero to
automatically determine based on core count.Copyright © 2014. All Rights Reserved.