/** * Finish constructing the object model. * This construsts the "global" variables, attributes and dimensions. * It also looks for coordinate variables. */ public void finish() { if (immutable) throw new IllegalStateException("Cant modify"); variables = new ArrayList<Variable>(); dimensions = new ArrayList<Dimension>(); gattributes = new ArrayList<Attribute>(); finishGroup(rootGroup); }
/** * Finish constructing the object model. * This construsts the "global" variables, attributes and dimensions. * It also looks for coordinate variables. */ public void finish() { if (immutable) throw new IllegalStateException("Cant modify"); variables = new ArrayList<>(); dimensions = new ArrayList<>(); gattributes = new ArrayList<>(); finishGroup(rootGroup); }
/** * Finish constructing the object model. * This construsts the "global" variables, attributes and dimensions. * It also looks for coordinate variables. */ public void finish() { if (immutable) throw new IllegalStateException("Cant modify"); variables = new ArrayList<>(); dimensions = new ArrayList<>(); gattributes = new ArrayList<>(); finishGroup(rootGroup); }
private void finishGroup(Group g) { variables.addAll(g.variables); // LOOK should group atts be promoted to global atts? for (Attribute oldAtt : g.attributes) { if (g == rootGroup) { gattributes.add(oldAtt); } else { String newName = makeFullNameWithString(g, oldAtt.getShortName()); // LOOK fishy gattributes.add(new Attribute(newName, oldAtt)); } } // LOOK this wont match the variables' dimensions if there are groups: what happens if we remove this ?? for (Dimension oldDim : g.dimensions) { if (oldDim.isShared()) { if (g == rootGroup) { dimensions.add(oldDim); } else { String newName = makeFullNameWithString(g, oldDim.getShortName()); // LOOK fishy dimensions.add(new Dimension(newName, oldDim)); } } } List<Group> groups = g.getGroups(); for (Group nested : groups) { finishGroup(nested); } }
private void finishGroup(Group g) { variables.addAll(g.variables); // LOOK should group atts be promoted to global atts? for (Attribute oldAtt : g.attributes) { if (g == rootGroup) { gattributes.add(oldAtt); } else { String newName = makeFullNameWithString(g, oldAtt.getShortName()); // LOOK fishy gattributes.add(new Attribute(newName, oldAtt)); } } // LOOK this wont match the variables' dimensions if there are groups: what happens if we remove this ?? for (Dimension oldDim : g.dimensions) { if (oldDim.isShared()) { if (g == rootGroup) { dimensions.add(oldDim); } else { String newName = makeFullNameWithString(g, oldDim.getShortName()); // LOOK fishy dimensions.add(new Dimension(newName, oldDim)); } } } List<Group> groups = g.getGroups(); for (Group nested : groups) { finishGroup(nested); } }
private void finishGroup(Group g) { variables.addAll(g.variables); // LOOK should group atts be promoted to global atts? for (Attribute oldAtt : g.getAttributes()) { if (g == rootGroup) { gattributes.add(oldAtt); } else { String newName = makeFullNameWithString(g, oldAtt.getShortName()); // LOOK fishy gattributes.add(new Attribute(newName, oldAtt)); } } // LOOK this wont match the variables' dimensions if there are groups: what happens if we remove this ?? for (Dimension oldDim : g.dimensions) { if (oldDim.isShared()) { if (g == rootGroup) { dimensions.add(oldDim); } else { String newName = makeFullNameWithString(g, oldDim.getShortName()); // LOOK fishy dimensions.add(new Dimension(newName, oldDim)); } } } List<Group> groups = g.getGroups(); for (Group nested : groups) { finishGroup(nested); } }