Package controller
Class Controller
java.lang.Object
controller.Controller
public class Controller
extends java.lang.Object
Controller class which handles the GUI, modules and a list of objects of the
 highest hierarchy (satellites).
- 
Field SummaryFields Modifier and Type Field Description private java.util.ArrayList<IAggregate>aggregationModulesprivate static ControllercontrollerSingleton instance of Controllerprivate GUIguiprivate java.util.ArrayList<IOutput>outputModulesprivate java.util.ArrayList<Satellite>satelliteList
- 
Constructor SummaryConstructors Modifier Constructor Description privateController()Constructor of Controller, holds GUI instance and passes itself to the GUI.
- 
Method SummaryModifier and Type Method Description voidaggregate()Fetches the selected method of aggregation and performs it on the data.static ControllergetInstance()Singleton getter for Controller, instantiates itself if and only if not already existent.private static java.lang.StringgetSourceFile()Asks the user for the file path of the JSON.voidinit(java.lang.String file)Makes sure file path to JSON file is existent and gets list of Satellites.voidinitModules()Loads aggregation and output modules and passes them to the GUI.private voidloadAggregationModules()Takes all modules in "/Aggregation_Modules", instantiates them and saves the objects in the aggregationModules list of aggregates.private voidloadOutputModules()Takes all modules in "/Output_Modules", instantiates them and saves the objects in the outputModules list of outputs.private voidoutput(CompositeContainer aggregationResult)Fetches the selected method of output and outputs the result of the aggregation.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Field Details- 
controllerSingleton instance of Controller
- 
gui
- 
satelliteList
- 
aggregationModules
- 
outputModules
 
- 
- 
Constructor Details- 
Controllerprivate Controller()Constructor of Controller, holds GUI instance and passes itself to the GUI.
 
- 
- 
Method Details- 
getInstanceSingleton getter for Controller, instantiates itself if and only if not already existent.- Returns:
- controller Controllerobject
 
- 
initpublic void init(java.lang.String file)Makes sure file path to JSON file is existent and gets list of Satellites.- Parameters:
- file- path of the given JSON file or null if not given
 
- 
initModulespublic void initModules()Loads aggregation and output modules and passes them to the GUI.
- 
getSourceFileprivate static java.lang.String getSourceFile()Asks the user for the file path of the JSON.- Returns:
- file path of the JSON file, if not given program exits with status -42
 
- 
aggregatepublic void aggregate()Fetches the selected method of aggregation and performs it on the data.
- 
outputFetches the selected method of output and outputs the result of the aggregation.- Parameters:
- aggregationResult- The result of the aggregation
 
- 
loadAggregationModulesprivate void loadAggregationModules()Takes all modules in "/Aggregation_Modules", instantiates them and saves the objects in the aggregationModules list of aggregates.
- 
loadOutputModulesprivate void loadOutputModules()Takes all modules in "/Output_Modules", instantiates them and saves the objects in the outputModules list of outputs.
 
-