Package org.opensourcephysics.tools
Class DataRefreshTool
java.lang.Object
org.opensourcephysics.tools.DataRefreshTool
- All Implemented Interfaces:
Tool
This tool sends data to any tool that requests it.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a Data object.static DataRefreshTool
Returns a DataRefreshTool for the specified data object.void
removeData
(Data data) Removes a Data object.void
Sends a job to this tool and specifies a tool to reply to.
-
Field Details
-
moreData
-
-
Method Details
-
getTool
Returns a DataRefreshTool for the specified data object.- Parameters:
data
- the data- Returns:
- the tool
-
send
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.getSelfContainedData(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. -
addData
Adds a Data object. Note: added Data objects must use the same independent variable as the original Data.- Parameters:
data
- the Data object to add
-
removeData
Removes a Data object.- Parameters:
data
- the Data object to remove
-