Advertisement
xnevemore

Untitled

Feb 5th, 2023
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.20 KB | None | 0 0
  1. public class MonitoringPoint {
  2.     private String referenceTitle;
  3.     private String coordinates;
  4.     private Map<String, String> information;
  5.  
  6.     public MonitoringPoint(String referenceTitle, String coordinates, Map<String, String> information) {
  7.         this.referenceTitle = referenceTitle;
  8.         this.coordinates = coordinates;
  9.         this.information = information;
  10.     }
  11.  
  12.     public String getReferenceTitle() {
  13.         return referenceTitle;
  14.     }
  15.  
  16.     public String getCoordinates() {
  17.         return coordinates;
  18.     }
  19.  
  20.     public Map<String, String> getInformation() {
  21.         return information;
  22.     }
  23. }
  24.  
  25. public class Check {
  26.     private String category;
  27.     private String unitsOfMeasurement;
  28.     private String measurementFrequency;
  29.     private Map<String, String> healthAndEnvironmentalRisks;
  30.  
  31.     public Check(String category, String unitsOfMeasurement, String measurementFrequency, Map<String, String> healthAndEnvironmentalRisks) {
  32.         this.category = category;
  33.         this.unitsOfMeasurement = unitsOfMeasurement;
  34.         this.measurementFrequency = measurementFrequency;
  35.         this.healthAndEnvironmentalRisks = healthAndEnvironmentalRisks;
  36.     }
  37.  
  38.     public String getCategory() {
  39.         return category;
  40.     }
  41.  
  42.     public String getUnitsOfMeasurement() {
  43.         return unitsOfMeasurement;
  44.     }
  45.  
  46.     public String getMeasurementFrequency() {
  47.         return measurementFrequency;
  48.     }
  49.  
  50.     public Map<String, String> getHealthAndEnvironmentalRisks() {
  51.         return healthAndEnvironmentalRisks;
  52.     }
  53. }
  54.  
  55. public class AnalysisLab {
  56.     private String title;
  57.     private Map<String, String> businessInformation;
  58.     private List<Check> checks;
  59.  
  60.     public AnalysisLab(String title, Map<String, String> businessInformation, List<Check> checks) {
  61.         this.title = title;
  62.         this.businessInformation = businessInformation;
  63.         this.checks = checks;
  64.     }
  65.  
  66.     public String getTitle() {
  67.         return title;
  68.     }
  69.  
  70.     public Map<String, String> getBusinessInformation() {
  71.         return businessInformation;
  72.     }
  73.  
  74.     public List<Check> getChecks() {
  75.         return checks;
  76.     }
  77. }
  78.  
  79. public class CheckRecord {
  80.     private Date date;
  81.     private Check check;
  82.     private String results;
  83.  
  84.     public CheckRecord(Date date, Check check, String results) {
  85.         this.date = date;
  86.         this.check = check;
  87.         this.results = results;
  88.     }
  89.  
  90.     public Date getDate() {
  91.         return date;
  92.     }
  93.  
  94.     public Check getCheck() {
  95.         return check;
  96.     }
  97.  
  98.     public String getResults() {
  99.         return results;
  100.     }
  101. }
  102.  
  103. public class System {
  104.     private List<MonitoringPoint> monitoringPoints;
  105.     private List<Check> checks;
  106.     private List<AnalysisLab> analysisLabs;
  107.     private List<CheckRecord> checkRecords;
  108.  
  109.     public System(List<MonitoringPoint> monitoringPoints, List<Check> checks, List<AnalysisLab> analysisLabs, List<CheckRecord> checkRecords) {
  110.         this.monitoringPoints = monitoringPoints;
  111.         this.checks = checks;
  112.         this.analysisLabs = analysisLabs;
  113.         this.checkRecords = checkRecords;
  114.     }
  115.  
  116.     public List<MonitoringPoint> getMonitoringPoints() {
  117.         return monitoringPoints;
  118.     }
  119.  
  120.     public List<Check> getChecks() {
  121.         return checks;
  122.     }
  123.  
  124.     public List<AnalysisLab> getAnalysisLabs() {
  125.         return analysisLabs;
  126.     }
  127.  
  128.     public List<CheckRecord> getCheckRecords() {
  129.         return checkRecords;
  130.     }
  131.  
  132.     public void addMonitoringPoint(MonitoringPoint monitoringPoint) {
  133.         monitoringPoints.add(monitoringPoint);
  134.     }
  135.  
  136.     public void addCheck(Check check) {
  137.         checks.add(check);
  138.     }
  139.  
  140.     public void addAnalysisLab(AnalysisLab analysisLab) {
  141.         analysisLabs.add(analysisLab);
  142.     }
  143.  
  144.     public void addCheckRecord(CheckRecord checkRecord) {
  145.         checkRecords.add(checkRecord);
  146.     }
  147.  
  148.     public void editMonitoringPoint(MonitoringPoint monitoringPoint) {
  149.         for (int i = 0; i < monitoringPoints.size(); i++) {
  150.             if (monitoringPoints.get(i).getReferenceTitle().equals(monitoringPoint.getReferenceTitle())) {
  151.                 monitoringPoints.set(i, monitoringPoint);
  152.                 break;
  153.             }
  154.         }
  155.     }
  156.  
  157.     public void editCheck(Check check) {
  158.         for (int i = 0; i < checks.size(); i++) {
  159.             if (checks.get(i).getCategory().equals(check.getCategory())) {
  160.                 checks.set(i, check);
  161.                 break;
  162.             }
  163.         }
  164.     }
  165.  
  166.     public void editAnalysisLab(AnalysisLab analysisLab) {
  167.         for (int i = 0; i < analysisLabs.size(); i++) {
  168.             if (analysisLabs.get(i).getTitle().equals(analysisLab.getTitle())) {
  169.                 analysisLabs.set(i, analysisLab);
  170.                 break;
  171.             }
  172.         }
  173.     }
  174.  
  175.     public void editCheckRecord(CheckRecord checkRecord) {
  176.         for (int i = 0; i < checkRecords.size(); i++) {
  177.             if (checkRecords.get(i).getCheck().getCategory().equals(checkRecord.getCheck().getCategory()) &&
  178.                 checkRecords.get(i).getDate().equals(checkRecord.getDate())) {
  179.                 checkRecords.set(i, checkRecord);
  180.                 break;
  181.             }
  182.         }
  183.     }
  184. }
  185.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement