org.opensourcephysics.tools
Class DataRefreshTool

java.lang.Object
  extended by org.opensourcephysics.tools.DataRefreshTool
All Implemented Interfaces:
java.rmi.Remote, Tool

public class DataRefreshTool
extends java.lang.Object
implements Tool

This tool sends data to any tool that requests it.

Version:
1.0
Author:
Douglas Brown

Method Summary
static DataRefreshTool getTool(Data data)
          Returns a DataRefreshTool for the specified data object.
 void send(Job job, Tool replyTo)
          Sends a job to this tool and specifies a tool to reply to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTool

public static DataRefreshTool getTool(Data data)
Returns a DataRefreshTool for the specified data object.

Parameters:
data - the data
Returns:
the tool

send

public void send(Job job,
                 Tool replyTo)
          throws java.rmi.RemoteException
Sends a job to this tool and specifies a tool to reply to. The job xml defines the Data object requesting a refresh ("requestData"). The requestData is compared with this tool's Data ("localData") as follows: 1. If the requestData ID matches the localData ID, then the localData is sent back to the requester. 2. If not, then the requestData ID is compared with the IDs of all Data objects in the list returned by DataTool.getDataList(localData). If a match is found, the matching Data is sent back to the requester. 3. If not, then the requestData ID is compared with the IDs of Datasets in the list returned by DataTool.getDatasets(localData). If a match is found, the matching Dataset is sent back to the requester. 4. If not, then every Dataset ID in the list returned by DataTool.getDatasets(requestData) is compared with the IDs of Datasets in the list returned by DataTool.getDatasets(localData). All matching Datasets that are found are sent back to the requester.

Specified by:
send in interface Tool
Parameters:
job - the Job
replyTo - the tool requesting refreshed data
Throws:
java.rmi.RemoteException