@Override public boolean removeMemberVariable( Variable v) { if (super.removeMemberVariable(v)) { java.util.Iterator<Variable> iter = orgVariables.iterator(); while (iter.hasNext()) { Variable mv = iter.next(); if (mv.getShortName().equals(v.getShortName())) { iter.remove(); return true; } } } return false; }
@Override public boolean removeMemberVariable( Variable v) { if (super.removeMemberVariable(v)) { java.util.Iterator<Variable> iter = orgVariables.iterator(); while (iter.hasNext()) { Variable mv = iter.next(); if (mv.getShortName().equals(v.getShortName())) { iter.remove(); return true; } } } return false; }
@Override public boolean removeMemberVariable( Variable v) { if (super.removeMemberVariable(v)) { java.util.Iterator<Variable> iter = orgVariables.iterator(); while (iter.hasNext()) { Variable mv = iter.next(); if (mv.getShortName().equals(v.getShortName())) { iter.remove(); return true; } } } return false; }
private void processSeq(Structure struct, Element parent) throws IOException { if (parent == null || struct == null) return; List<Variable> vars = struct.getVariables(); for (Element child : parent.getChildren("fld", Catalog.ncmlNS)) { String idxS = child.getAttributeValue("idx"); int idx = Integer.parseInt(idxS); if (idx < 0 || idx >= vars.size()) { log.error("Bad index = %s", child); continue; } Variable want = vars.get(idx); struct.removeMemberVariable(want); System.out.printf("removed %s%n", want); } }
private void cmdRemove(Variable v, String type, String name) { boolean err = false; if (type.equals("attribute")) { ucar.nc2.Attribute a = v.findAttribute(name); if (a != null) { v.remove(a); if (debugCmd) System.out.println("CMD remove " + type + " " + name); } else err = true; } else if (type.equals("variable") && v instanceof Structure) { Structure s = (Structure) v; Variable nested = s.findVariable(name); if (nested != null) { s.removeMemberVariable(nested); if (debugCmd) System.out.println("CMD remove " + type + " " + name); } else err = true; } if (err) { Formatter f = new Formatter(); f.format("CMD remove %s CANT find %s location %s%n", type, name, location); log.info(f.toString()); } }
private void cmdRemove(Variable v, String type, String name) { boolean err = false; if (type.equals("attribute")) { ucar.nc2.Attribute a = v.findAttribute(name); if (a != null) { v.remove(a); if (debugCmd) System.out.println("CMD remove " + type + " " + name); } else err = true; } else if (type.equals("variable") && v instanceof Structure) { Structure s = (Structure) v; Variable nested = s.findVariable(name); if (nested != null) { s.removeMemberVariable(nested); if (debugCmd) System.out.println("CMD remove " + type + " " + name); } else err = true; } if (err) { Formatter f = new Formatter(); f.format("CMD remove %s CANT find %s location %s%n", type, name, location); log.info(f.toString()); } }
private void cmdRemove(Variable v, String type, String name) { boolean err = false; if (type.equals("attribute")) { ucar.nc2.Attribute a = v.findAttribute(name); if (a != null) { v.remove(a); if (debugCmd) System.out.println("CMD remove " + type + " " + name); } else err = true; } else if (type.equals("variable") && v instanceof Structure) { Structure s = (Structure) v; Variable nested = s.findVariable(name); if (nested != null) { s.removeMemberVariable(nested); if (debugCmd) System.out.println("CMD remove " + type + " " + name); } else err = true; } if (err) { Formatter f = new Formatter(); f.format("CMD remove %s CANT find %s location %s%n", type, name, location); log.info(f.toString()); } }