package com.maxmind.geoip2;


import java.lang.*;
import java.util.*;
import java.io.*;
import org.json.*;

public class City extends Country
{
  private CityRecord city;
  private LocationRecord location;
  private RepresentedCountry representedCountry;
  private Vector<SubDivision> subDivisionsList;
  City(JSONObject json) {
    super(json);
    try {
      JSONObject jcity = json.getJSONObject("city");
      city = new CityRecord(jcity);      
      JSONObject jlocation = json.getJSONObject("location");
      location = new LocationRecord(jlocation);
      if (json.has("represented_country")) {
        JSONObject rcountry = json.getJSONObject("represented_country");
        representedCountry = new RepresentedCountry(rcountry);
      }
      subDivisionsList = new Vector<SubDivision>();
      JSONArray subDivisionsArray = json.getJSONArray("subdivisions");
      int length = subDivisionsArray.length();
      for (int i = 0;i < length;i++) {
        JSONObject jsubDivision = subDivisionsArray.getJSONObject(i);
        subDivisionsList.add(new SubDivision(jsubDivision));
      }
    } catch (JSONException e) {
      e.printStackTrace();
    }  
  }
  public CityRecord getCity() {
    return city;
  }
  public LocationRecord getLocation() {
    return location;
  }
  public RepresentedCountry getRepresentedCountry() {
    return representedCountry;
  }
  public Vector<SubDivision> getSubDivisionsList() {
    return subDivisionsList;
  }
}


@@ -258,27 +258,30 @@
 private 
-Vector
+ArrayList
 %3CSub
-D
+d
 ivision%3E
@@ -280,25 +280,25 @@
 ivision%3E sub
-D
+d
 ivisionsList
@@ -746,33 +746,33 @@
      %7D%0A      sub
-D
+d
 ivisionsList = n
@@ -774,27 +774,30 @@
 t = new 
-Vector
+ArrayList
 %3CSub
-D
+d
 ivision%3E
@@ -815,25 +815,25 @@
 SONArray sub
-D
+d
 ivisionsArra
@@ -889,25 +889,25 @@
 length = sub
-D
+d
 ivisionsArra
@@ -976,25 +976,25 @@
 NObject jsub
-D
+d
 ivision = su
@@ -990,25 +990,25 @@
 vision = sub
-D
+d
 ivisionsArra
@@ -1034,25 +1034,25 @@
 %0A        sub
-D
+d
 ivisionsList
@@ -1063,17 +1063,17 @@
 (new Sub
-D
+d
 ivision(
@@ -1076,17 +1076,17 @@
 ion(jsub
-D
+d
 ivision)
@@ -1387,19 +1387,22 @@
 lic 
-Vector
+ArrayList
 %3CSub
-D
+d
 ivis
@@ -1412,17 +1412,17 @@
 %3E getSub
-D
+d
 ivisions
@@ -1448,9 +1448,9 @@
  sub
-D
+d
 ivis

replace Vector with ArrayList