Package algorithm

Class DataService

java.lang.Object
algorithm.DataService

public class DataService extends Object
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 Details

  • Method Details

    • setTrackingDataSource

      public void setTrackingDataSource(AbstractTrackingDataSource source)
    • restartMeasurements

      public void restartMeasurements()
      Restarts all measurements: resets the internal list of tools.
    • getDataManager

      public TrackingDataManager getDataManager()
    • setDataManager

      public void setDataManager(TrackingDataManager dataManager)
    • getToolByName

      public Tool getToolByName(String name) throws Exception
      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

      public AverageMeasurement getAverageMeasurement(String name) throws Exception
      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

      public List<Tool> loadNextData(int countToGetNext)
      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

      public List<Tool> loadNextData(int countToGetNext, boolean updateSource)