Green Energy Ltd. has recently employed you as a consultant software developer in its Systems department.
You have been contracted to help design and develop data collection and analysis software to monitor Electromagnetic-field (EM-field) energy levels in order to help Ireland meet the EU Directive on electricity pollution levels. In the project scope, it is required that multiple EM-field stations will be placed around the Irish Electricity Network and each station will capture data via its EM-field detectors.
(a) Develop a class EMfieldDetector to model the detected data via an array and methods operating on the array. The class should have the following members:
Include your Java code into your solution document.
(b) Develop the implementation of a method isCompliant that will compare the contents of the Detector objects integer array with the contents of the argument (EU compliant) objects array. The contents of the detector object is deemed to be compliant if both objects respective arrays are of the same size and contain the same numbers in matching order.
Include your Java code for the isCompliant method into your solution document.
(c) Add a method to the EMfieldDetector class called recordEnergyReading which writes all numbers in the int array to a file specified by the String argument. For example, the call recordEnergyReading (detectordata.txt) will write to the file detectordata.txt. Each number written to the file should be separated from the next by a blank space.
Include your Java code for the recordEnergyReading method into your solution document.
(d) Add a method to the EMfieldDetector class called loadEnergyData that reads int numbers from a target file (the file name is specified by the String argument). So the call loadEnergyData (detectordata.txt) will read the int numbers in the file dectordatadata.txt into the int array within EMfieldDetector.
Include your Java code for the loadEnergyData method into your solution document.
(e) Write a class TestEMfieldDetector with a main method that will create a number of EMfieldDetector objects. Your code should fully test all the functionality of the EMfieldDetector class including the isCompliant method. Include your Java code and the resulting output into your solution document.
(f) You discover that the detector produces additional data points under certain conditions, for example, near heavily populated urban areas. Briefly explain the changes you need to make to the EMfieldDetector class and why. In your answer, refer to each of the below collection types and explain whether it is well-suited to replacing the int array in the EMfieldDetector class: