So I am parsing a VERY large JSON file with the use of GSON. The class I'm parsing it into is structure like this:
What I'm trying to do is round the doubles (in the HashSet, in the Geometry class) up to to 4 decimal points. So as doubles are being added to the HashSet, I want to round them up.
public class Contours {
public String name = null;
public String type = null;
ArrayList<Features> features = null;
class Features {
public String type = null;
public Geometry geometry = null;
public Properties properties = null;
}
class Geometry {
public String type = null;
HashSet<double[]> coordinates = null;
}
class Properties {
public String CONTOUR = null;
public int OBJECTID;
public String LAYER = null;
public double ELEVATION;
}
}
Why I can't do this iteratively after GSON has parsed the file?
The file is VERY large, and has 412,064 lines and is 27.5mb large. So doing that will take very long time.
NOTE: this parsing happens every time this app is run, so speed is necessary.
Thanks
null
, anyway; the produced bytecode is identical), nor to humans (it's just clutter; why don't you initialize the other fields?).