Package algorithm
Class DataService
java.lang.Object
algorithm.DataService
The class DataService represents the interface to team 1
Access to calculation with trackingdata over DataProcessor.
Access to trackingtool data and its source over DataManager.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAverageMeasurement
(String name) This method checks if the tool exists and returns the average measurement of all collected data of that toolgetToolByName
(String name) This method checks if the tool exists.loadNextData
(int countToGetNext) The method loadNextData gets a number of how much data should be reloaded.loadNextData
(int countToGetNext, boolean updateSource) void
Restarts all measurements: resets the internal list of tools.void
setDataManager
(TrackingDataManager dataManager) void
-
Constructor Details
-
DataService
public DataService() -
DataService
-
-
Method Details
-
setTrackingDataSource
-
restartMeasurements
public void restartMeasurements()Restarts all measurements: resets the internal list of tools. -
getDataManager
-
setDataManager
-
getToolByName
This method checks if the tool exists. A for-loop is used to go through the list of tools of type ToolMeasure. If the name of the searched tool is the same as in the list then the tool will be returned, if there is no tool with the name, the exception is thrown.- Returns:
- toolMeasure - of type ToolMeasure
- Throws:
Exception
- if tool is not found
-
getAverageMeasurement
This method checks if the tool exists and returns the average measurement of all collected data of that tool- Returns:
- average measurement of that tool
- Throws:
Exception
- an exception if the tool was not found
-
loadNextData
The method loadNextData gets a number of how much data should be reloaded. In a loop the tools of DataMangager are brought. A list of measurements is created. AverageMeasurment is called and calculated. LoadNextData calls different methods and computes them. The results are added to average Measurement..- Parameters:
countToGetNext
- - number of the reloaded data- Returns:
- dataManager.getToolMeasures() - list of tools of type ToolMesure
-
loadNextData
-