-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetCTData.pde
More file actions
36 lines (31 loc) · 1.2 KB
/
GetCTData.pde
File metadata and controls
36 lines (31 loc) · 1.2 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
class GetCTData {
JSONObject json;
int bandA, bandB, bandC, bandD, bandE, bandF, bandG, bandH;
float bandAPrice, bandBPrice, bandCPrice, bandDPrice, bandEPrice, bandFPrice, bandGPrice, bandHPrice;
GetCTData() {
//Loading the JSON data file and setting all array lengths.
json = loadJSONObject("CouncilTaxDistribution.json");
}
void run() {
//Data is put into Arrays
JSONObject borough = json.getJSONObject(currentBorough);
//Number of household within each band
bandA = borough.getInt("Band A");
bandB = borough.getInt("Band B");
bandC = borough.getInt("Band C");
bandD = borough.getInt("Band D");
bandE = borough.getInt("Band E");
bandF = borough.getInt("Band F");
bandG = borough.getInt("Band G");
bandH = borough.getInt("Band H");
//Price average of each band
bandAPrice = borough.getFloat("£ Band A");
bandBPrice = borough.getFloat("£ Band B");
bandCPrice = borough.getFloat("£ Band C");
bandDPrice = borough.getFloat("£ Band D");
bandEPrice = borough.getFloat("£ Band E");
bandFPrice = borough.getFloat("£ Band F");
bandGPrice = borough.getFloat("£ Band G");
bandHPrice = borough.getFloat("£ Band H");
}
}