org.opensourcephysics.tools
Class JobManager

java.lang.Object
  extended by org.opensourcephysics.tools.JobManager

public class JobManager
extends java.lang.Object

This manages jobs and their associated objects and replies.

Version:
1.0
Author:
Wolfgang Christian and Doug Brown

Constructor Summary
JobManager(Tool tool)
          Constructs a job manager for a specified tool.
 
Method Summary
 void associate(Job job, java.lang.Object obj)
          Associates a job with the specified object.
 Job[] getJobs(java.lang.Object obj)
          Gets the jobs associated with the specified object.
 java.lang.Object[] getObjects(Job job)
          Gets the objects associated with the specified job.
 java.util.Collection<Tool> getTools(java.lang.Object obj)
          Gets the tools interested in the specified object.
 void log(Job job, Tool tool)
          Logs a job and tool into the manager.
 void sendReplies(Job job)
          Replies to tools interested in the specified job.
 void sendReplies(java.lang.Object obj)
          Replies to tools interested in the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobManager

public JobManager(Tool tool)
Constructs a job manager for a specified tool.

Parameters:
tool - the tool
Method Detail

log

public void log(Job job,
                Tool tool)
Logs a job and tool into the manager.

Parameters:
job - the job
tool - a tool interested in the job

associate

public void associate(Job job,
                      java.lang.Object obj)
Associates a job with the specified object.

Parameters:
job - the job
obj - the object

getJobs

public Job[] getJobs(java.lang.Object obj)
Gets the jobs associated with the specified object.

Parameters:
obj - the object
Returns:
an array of Jobs

getObjects

public java.lang.Object[] getObjects(Job job)
Gets the objects associated with the specified job.

Parameters:
job - the job
Returns:
an array of objects

getTools

public java.util.Collection<Tool> getTools(java.lang.Object obj)
Gets the tools interested in the specified object.

Parameters:
obj - the object
Returns:
a collection of tools

sendReplies

public void sendReplies(java.lang.Object obj)
Replies to tools interested in the specified object.

Parameters:
obj - the object

sendReplies

public void sendReplies(Job job)
Replies to tools interested in the specified job.

Parameters:
job - the job