/** * Delete a global Attribute. Must be in define mode. * @param attName existing Attribute has this name * @return deleted Attribute, or null if not found */ public Attribute deleteGlobalAttribute(String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(attName); if (null == att) return null; rootGroup.remove(att); return att; }
/** * Delete a global Attribute. Must be in define mode. * @param attName existing Attribute has this name * @return deleted Attribute, or null if not found */ public Attribute deleteGlobalAttribute(String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(attName); if (null == att) return null; rootGroup.remove(att); return att; }
private void removeAttribute(Object parent, Attribute att) { if (parent instanceof Group) ((Group) parent).remove(att); else if (parent instanceof Variable) ((Variable) parent).remove(att); }
private void removeAttribute(Object parent, Attribute att) { if (parent instanceof Group) ((Group) parent).remove(att); else if (parent instanceof Variable) ((Variable) parent).remove(att); }
private void removeAttribute(Object parent, Attribute att) { if (parent instanceof Group) ((Group) parent).remove(att); else if (parent instanceof Variable) ((Variable) parent).remove(att); }
/** * Delete a global Attribute. Must be in define mode. * @param attName existing Attribute has this name * @return deleted Attribute, or null if not found */ public Attribute deleteGlobalAttribute(String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(attName); if (null == att) return null; rootGroup.remove(att); return att; }
/** * Delete a group Attribute. Must be in define mode. * @param g the group to add to. if null, use root group * @param attName existing Attribute has this name * @return deleted Attribute, or null if not found */ public Attribute deleteGroupAttribute(Group g, String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (g == null) g = ncfile.getRootGroup(); Attribute att = g.findAttribute(attName); if (null == att) return null; g.remove(att); return att; }
/** * Delete a group Attribute. Must be in define mode. * * @param g the group to add to. if null, use root group * @param attName existing Attribute has this name * @return deleted Attribute, or null if not found */ public Attribute deleteGroupAttribute(Group g, String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (g == null) g = ncfile.getRootGroup(); Attribute att = g.findAttribute(attName); if (null == att) return null; g.remove(att); return att; }
/** * Delete a group Attribute. Must be in define mode. * * @param g the group to add to. if null, use root group * @param attName existing Attribute has this name * @return deleted Attribute, or null if not found */ public Attribute deleteGroupAttribute(Group g, String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (g == null) g = ncfile.getRootGroup(); Attribute att = g.findAttribute(attName); if (null == att) return null; g.remove(att); return att; }
/** * Rename a global Attribute. Must be in define mode. * @param oldName existing Attribute has this name * @param newName rename to this * @return renamed Attribute, or null if not found */ public Attribute renameGlobalAttribute(String oldName, String newName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(oldName); if (null == att) return null; rootGroup.remove(att); att = new Attribute( newName, att.getValues()); rootGroup.addAttribute( att); return att; }
/** * Rename a global Attribute. Must be in define mode. * @param oldName existing Attribute has this name * @param newName rename to this * @return renamed Attribute, or null if not found */ public Attribute renameGlobalAttribute(String oldName, String newName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(oldName); if (null == att) return null; rootGroup.remove(att); att = new Attribute( newName, att.getValues()); rootGroup.addAttribute( att); return att; }
/** * Rename a global Attribute. Must be in define mode. * @param oldName existing Attribute has this name * @param newName rename to this * @return renamed Attribute, or null if not found */ public Attribute renameGlobalAttribute(String oldName, String newName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(oldName); if (null == att) return null; rootGroup.remove(att); att = new Attribute( newName, att.getValues()); rootGroup.addAttribute( att); return att; }
current.remove(dim);
current.remove(dim);
/** * Rename a group Attribute. Must be in define mode. * @param g the group to add to. if null, use root group * @param oldName existing Attribute has this name * @param newName rename to this * @return renamed Attribute, or null if not found */ public Attribute renameGlobalAttribute(Group g, String oldName, String newName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(newName)) { String newnewName = createValidObjectName(newName); log.warn("illegal attribute name= "+newName + " change to "+ newnewName); newName = newnewName; } if (g == null) g = ncfile.getRootGroup(); Attribute att = g.findAttribute(oldName); if (null == att) return null; g.remove(att); att = new Attribute( newName, att.getValues()); g.addAttribute( att); return att; }
/** * Rename a group Attribute. Must be in define mode. * * @param g the group to add to. if null, use root group * @param oldName existing Attribute has this name * @param newName rename to this * @return renamed Attribute, or null if not found */ public Attribute renameGroupAttribute(Group g, String oldName, String newName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(newName)) { String newnewName = createValidObjectName(newName); log.warn("illegal attribute name= " + newName + " change to " + newnewName); newName = newnewName; } if (g == null) g = ncfile.getRootGroup(); Attribute att = g.findAttribute(oldName); if (null == att) return null; g.remove(att); att = new Attribute(newName, att.getValues()); g.addAttribute(att); return att; }
/** * Rename a group Attribute. Must be in define mode. * * @param g the group to add to. if null, use root group * @param oldName existing Attribute has this name * @param newName rename to this * @return renamed Attribute, or null if not found */ public Attribute renameGlobalAttribute(Group g, String oldName, String newName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(newName)) { String newnewName = createValidObjectName(newName); log.warn("illegal attribute name= " + newName + " change to " + newnewName); newName = newnewName; } if (g == null) g = ncfile.getRootGroup(); Attribute att = g.findAttribute(oldName); if (null == att) return null; g.remove(att); att = new Attribute(newName, att.getValues()); g.addAttribute(att); return att; }
boolean gotit = (v != null) && (v instanceof Structure); if (gotit) { rootGroup.remove(v); variables.remove(v); removeRecordStructure();
@Deprecated protected void reGroupVariable(Group rootgroup, DODSVariable dodsv) throws opendap.dap.DAP2Exception { String dodsname = dodsv.getDODSName(); NamePieces pieces = parseName(dodsname); if (pieces.prefix != null) { // convert prefix to an actual group Group gnew = rootgroup.makeRelativeGroup(this, dodsname, true); // Get current group for the variable Group gold = null; gold = dodsv.getParentGroup(); if (gnew != gold) { gold.remove(dodsv); dodsv.setParentGroup(gnew); gnew.addVariable(dodsv); if (OLDGROUPCODE) { dodsv.setName(pieces.name); } } } }
private void makeCoordinateVariable(Group parentGroup, Variable v, Array data) { String name = v.getShortName(); // replace in Variable Dimension oldDimension = v.getDimension(0); Dimension newDimension = new Dimension(name, oldDimension.getLength()); // newDimension.setCoordinateAxis( v); calcCoordinateVaribale will do this v.setDimension(0, newDimension); // replace old (if it exists) in Group with shared dimension Dimension old = parentGroup.findDimension(name); parentGroup.remove(old); parentGroup.addDimension(newDimension); // might as well cache the data if (data != null) { v.setCachedData(data); if (debugCached) System.out.println(" cache for <" + name + "> length =" + data.getSize()); } }