Repository navigation
Expand file tree
/
Copy pathData.java
More file actions
62 lines (52 loc) · 1.45 KB
/
Copy pathData.java
File metadata and controls
62 lines (52 loc) · 1.45 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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package program_1;
/**
*
* @author rjpls
*/
public class Data implements Comparable<Data> {
private Long newCases;
private Long totalCases;
private String continent;
private Long pop;
private String location;
private String date;
public Data(String[] string){
this.newCases = Long.parseLong(string[4]);
this.continent = string[0];
this.totalCases = Long.parseLong(string[3]);
this.pop = Long.parseLong(string[5]);
this.location = string[1];
this.date = string[2];
}
public int compareTo(Data x){
if(this.newCases < x.newCases){
return -1;
}
if(this.newCases > x.newCases){
return 1;
}
return 0;
}
public Long getNewCases(){
return newCases;
}
public String getContinent(){
return this.continent;
}
public Long getTotalCases(){
return this.totalCases;
}
public Long getPop(){
return this.pop;
}
public String getLocation(){
return this.location;
}
public String getDate(){
return this.date;
}
}