This repository was archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDisasterDescription.java
More file actions
67 lines (60 loc) · 1.99 KB
/
DisasterDescription.java
File metadata and controls
67 lines (60 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package codingcompetition2019;
/**
* A class representing the DisasterDescription object
* @author Sidhartha Chaganti, schaganti@gatech.edu
* @version 1.0.0
*/
public class DisasterDescription {
private String year;
private String category;
private int reportedIncidentsNum;
private double avgIncidents;
/**
* Constructs a DisasterDescription object with the fields for the basic requirements
* @param category The category of the disaster(s)
* @param year The year the disaster(s) took place
* @param reportedIncidentsNum The number of disasters of this type occured in this year
*/
public DisasterDescription(String category, String year, int reportedIncidentsNum) {
this.year = year;
this.category = category;
this.reportedIncidentsNum = reportedIncidentsNum;
}
/**
* Constructs a DisasterDescription object with the fields for the bonus feature of average number of incidents per year by category
* @param category The category of the disaster(s)
* @param avgIncidents The average number of incidents per year for this category
*/
public DisasterDescription(String category, double avgIncidents) {
this.category = category;
this.avgIncidents = avgIncidents;
}
/**
* Returns the year of this instance
* @return The year of this instance
*/
public String getYear() {
return year;
}
/**
* Returns the category of this instance
* @return The category of this instance
*/
public String getCategory() {
return category;
}
/**
* Returns the number of reported incidents
* @return The number of reported incidents
*/
public int getReportedIncidentsNum() {
return reportedIncidentsNum;
}
/**
* Returns the average number of incidents per year for this category
* @return The average number of incidents
*/
public double getAvgIncidents() {
return avgIncidents;
}
}