protected Group makeRootGroup() { Group root = new Group(this, null, ""); root.setParentGroup(null); return root; }
protected Group makeRootGroup() { Group root = new Group(this, null, ""); // The value of rootGroup will be queried during the course of setParentGroup. // If there's an existing rootGroup that we're trying to replace, it's important that the value of the // field be null for that. rootGroup = null; root.setParentGroup(null); return root; }
protected Group makeRootGroup() { Group root = new Group(this, null, ""); root.setParentGroup(null); return root; }
/** * Add a Group to the file. Must be in define mode. * If pass in null as the parent then the root group is returned and the name is ignored. * This is how you get the root group. Note this is different from other uses of parent group. * * @param parent the parent of this group, if null then returns the root group. * @param name the name of this group, unique within parent * @return the created group */ public Group addGroup(Group parent, String name) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (parent == null) return ncfile.getRootGroup(); Group result = new Group(ncfile, parent, name); parent.addGroup(result); return result; }
/** * Add a Group to the file. Must be in define mode. * If pass in null as the parent then the root group is returned and the name is ignored. * This is how you get the root group. Note this is different from other uses of parent group. * * @param parent the parent of this group, if null then returns the root group. * @param name the name of this group, unique within parent * @return the created group */ public Group addGroup(Group parent, String name) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (parent == null) return ncfile.getRootGroup(); Group result = new Group(ncfile, parent, name); parent.addGroup(result); return result; }
/** * Add a Group to the file. Must be in define mode. * If pass in null as the parent then the root group is returned and the name is ignored. * This is how you get the root group. Note this is different from other uses of parent group. * * @param parent the parent of this group, if null then returns the root group. * @param name the name of this group, unique within parent * @return the created group */ public Group addGroup(Group parent, String name) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (parent == null) return ncfile.getRootGroup(); Group result = new Group(ncfile, parent, name); parent.addGroup(result); return result; }
next = new Group(ncf, current, clearname); current.addGroup(next);
next = new Group(ncf, current, clearname); current.addGroup(next);
next = new Group(ncf, current, clearname); current.addGroup(next);
private void addGroup(NetcdfFile ncfile, Group parent, GribCollectionImmutable.GroupGC group, GribCollectionImmutable.Type gctype, boolean useGroups) { Group g; if (useGroups) { g = new Group(ncfile, parent, group.getId()); g.addAttribute(new Attribute(CDM.LONG_NAME, group.getDescription())); try { ncfile.addGroup(parent, g); } catch (Exception e) { logger.warn("Duplicate Group - skipping"); return; } } else { g = parent; } makeGroup(ncfile, g, group, gctype); }
if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); Group child = new Group(ncfile, g4.g, makeString(name)); g4.g.addGroup(child); makeGroup(new Group4(group_id, child, g4));
ret = nc4.nc_inq_grpname(group_id, name); if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); Group child = new Group(ncfile, g4.g, makeString(name)); g4.g.addGroup(child); makeGroup(group_id, new Group4(child, g4));
if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); Group child = new Group(ncfile, g4.g, makeString(name)); g4.g.addGroup(child); makeGroup(new Group4(group_id, child, g4));
private void convertGroup(Group g, Group from) { for (EnumTypedef et : from.getEnumTypedefs()) g.addEnumeration(et); for (Dimension d : from.getDimensions()) g.addDimension(new Dimension(d.getShortName(), d)); for (Attribute a : from.getAttributes()) g.addAttribute(a); for (Variable v : from.getVariables()) g.addVariable(convertVariable(g, v)); for (Group nested : from.getGroups()) { Group nnested = new Group(this, g, nested.getShortName()); g.addGroup(nnested); convertGroup(nnested, nested); } }
Group topGroup; if (useDatasetGroup) { topGroup = new Group(ncfile, null, ds.getType().toString()); ncfile.addGroup(null, topGroup); } else {
private void convertGroup(Group g, Group from) { for (EnumTypedef et : from.getEnumTypedefs()) g.addEnumeration(et); for (Dimension d : from.getDimensions()) g.addDimension(new Dimension(d.getShortName(), d)); for (Attribute a : from.getAttributes()) g.addAttribute(a); for (Variable v : from.getVariables()) g.addVariable(convertVariable(g, v)); for (Group nested : from.getGroups()) { Group nnested = new Group(this, g, nested.getShortName()); g.addGroup(nnested); convertGroup(nnested, nested); } }
private void convertGroup(Group g, Group from) { for (EnumTypedef et : from.getEnumTypedefs()) g.addEnumeration(et); for (Dimension d : from.getDimensions()) g.addDimension(new Dimension(d.getShortName(), d)); for (Attribute a : from.getAttributes()) g.addAttribute(a); for (Variable v : from.getVariables()) g.addVariable(convertVariable(g, v)); for (Group nested : from.getGroups()) { Group nnested = new Group(this, g, nested.getShortName()); g.addGroup(nnested); convertGroup(nnested, nested); } }
static void readGroup(NcStreamProto.Group proto, NetcdfFile ncfile, Group g) throws InvalidProtocolBufferException { for (NcStreamProto.Dimension dim : proto.getDimsList()) g.addDimension(NcStream.decodeDim(dim)); for (NcStreamProto.Attribute att : proto.getAttsList()) g.addAttribute(NcStream.decodeAtt(att)); for (NcStreamProto.EnumTypedef enumType : proto.getEnumTypesList()) g.addEnumeration(NcStream.decodeEnumTypedef(enumType)); for (NcStreamProto.Variable var : proto.getVarsList()) g.addVariable(NcStream.decodeVar(ncfile, g, null, var)); for (NcStreamProto.Structure s : proto.getStructsList()) g.addVariable(NcStream.decodeStructure(ncfile, g, null, s)); for (NcStreamProto.Group gp : proto.getGroupsList()) { Group ng = new Group(ncfile, g, gp.getName()); g.addGroup(ng); readGroup(gp, ncfile, ng); } }
static void readGroup(NcStreamProto.Group proto, NetcdfFile ncfile, Group g) throws InvalidProtocolBufferException { for (NcStreamProto.Dimension dim : proto.getDimsList()) g.addDimension(NcStream.decodeDim(dim)); for (NcStreamProto.Attribute att : proto.getAttsList()) g.addAttribute(NcStream.decodeAtt(att)); for (NcStreamProto.EnumTypedef enumType : proto.getEnumTypesList()) g.addEnumeration(NcStream.decodeEnumTypedef(enumType)); for (NcStreamProto.Variable var : proto.getVarsList()) g.addVariable(NcStream.decodeVar(ncfile, g, null, var)); for (NcStreamProto.Structure s : proto.getStructsList()) g.addVariable(NcStream.decodeStructure(ncfile, g, null, s)); for (NcStreamProto.Group gp : proto.getGroupsList()) { Group ng = new Group(ncfile, g, gp.getName()); g.addGroup(ng); readGroup(gp, ncfile, ng); } }
static void readGroup(NcStreamProto.Group proto, NetcdfFile ncfile, Group g) throws InvalidProtocolBufferException { for (NcStreamProto.Dimension dim : proto.getDimsList()) g.addDimension(NcStream.decodeDim(dim)); for (NcStreamProto.Attribute att : proto.getAttsList()) g.addAttribute(NcStream.decodeAtt(att)); for (NcStreamProto.EnumTypedef enumType : proto.getEnumTypesList()) g.addEnumeration(NcStream.decodeEnumTypedef(enumType)); for (NcStreamProto.Variable var : proto.getVarsList()) g.addVariable(NcStream.decodeVar(ncfile, g, null, var)); for (NcStreamProto.Structure s : proto.getStructsList()) g.addVariable(NcStream.decodeStructure(ncfile, g, null, s)); for (NcStreamProto.Group gp : proto.getGroupsList()) { Group ng = new Group(ncfile, g, gp.getName()); g.addGroup(ng); readGroup(gp, ncfile, ng); } }