-
Notifications
You must be signed in to change notification settings - Fork 0
/
StateStats.java
60 lines (51 loc) · 1.08 KB
/
StateStats.java
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
public class StateStats {
private String state;
private String abbreviation;
private int fa;
private int a;
private int ga;
private int b;
private int c;
private int start;
private int stub;
public StateStats (String state, String abbreviation, int fa, int a, int ga, int b, int c, int start, int stub) {
this.state = state;
this.fa=fa;
this.a=a;
this.ga=ga;
this.b=b;
this.c=c;
this.start=start;
this.stub=stub;
this.abbreviation = abbreviation;
}
public String GetBest() {
if (fa > 0)
return "FA";
if (a > 0)
return "A";
if (ga > 0)
return "GA";
if (b > 0)
return "B";
if (c > 0)
return "C";
if (start > 0)
return "Start";
if (stub > 0)
return "Stub";
return "List";
}
public String toString() {
return abbreviation + ": " + fa + " " + a + " " + ga + " " + b + " " + c + " " + start + " " + stub;
}
public String getAbbreviation() {
return abbreviation;
}
public int getStubs() {
return stub;
}
public double getWikiWork() {
return (1*a+2*ga+3*b+4*c+5*start+6*stub) / ((double)(fa+a+ga+b+c+start+stub));
}
}