-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDAO.java
More file actions
44 lines (39 loc) · 1.11 KB
/
DAO.java
File metadata and controls
44 lines (39 loc) · 1.11 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
public class DAO {
private final String state;
private final int count;
private final int min;
private final int max;
private final int avg;
public DAO(String state, int count, int min, int max, int avg) {
this.state = state;
this.count = count;
this.min = min;
this.max = max;
this.avg = avg;
}
String getState() { return state; }
int getCount() { return count; }
int getMin() { return min; }
int getMax() { return max; }
int getAvg() { return avg; }
@Override
public String toString() {
return String.format("%s, %d, %d, %d, %d", state, count, min, max, avg);
}
public String get(String column) {
switch (column) {
case "State":
return state;
case "Count":
return String.format("%d", count);
case "Low":
return String.format("%d", min);
case "High":
return String.format("%d", max);
case "Average":
return String.format("%d", avg);
default:
return "";
}
}
}