/** * Add a group to the parent group. * * @param parent add to this group. If group is null, use root group * @param g add this group * @return the group that was added */ public Group addGroup(Group parent, Group g) { if (immutable) throw new IllegalStateException("Cant modify"); if (parent == null) parent = rootGroup; parent.addGroup(g); return g; }
/** * Add a group to the parent group. * * @param parent add to this group. If group is null, use root group * @param g add this group * @return the group that was added */ public Group addGroup(Group parent, Group g) { if (immutable) throw new IllegalStateException("Cant modify"); if (parent == null) parent = rootGroup; parent.addGroup(g); return g; }
/** * Add a group to the parent group. * * @param parent add to this group. If group is null, use root group * @param g add this group * @return the group that was added */ public Group addGroup(Group parent, Group g) { if (immutable) throw new IllegalStateException("Cant modify"); if (parent == null) parent = rootGroup; parent.addGroup(g); return g; }
/** * 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; }
if (next == null) { next = new Group(ncf, current, clearname); current.addGroup(next);
if (next == null) { next = new Group(ncf, current, clearname); current.addGroup(next);
if (next == null) { next = new Group(ncf, current, clearname); current.addGroup(next);
private void addGroupToGroup(Group parent, Group g, Tag tag) { Group groupExisting = parent.findGroup(g.getShortName()); if (groupExisting != null) { g.setName(g.getShortName() + tag.refno); } parent.addGroup(g); }
private void addGroupToGroup(Group parent, Group g, Tag tag) { Group groupExisting = parent.findGroup(g.getShortName()); if (groupExisting != null) { g.setName(g.getShortName() + tag.refno); } parent.addGroup(g); }
private void addGroupToGroup(Group parent, Group g, Tag tag) { Group groupExisting = parent.findGroup(g.getShortName()); if (groupExisting != null) { g.setName(g.getShortName() + tag.refno); } parent.addGroup(g); }
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));
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));
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); } }
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); } }