public boolean addDimensionIfNotExists(Dimension d) { if (immutable) throw new IllegalStateException("Cant modify"); if (findDimensionLocal(d.getShortName()) != null) return false; dimensions.add(d); d.setGroup(this); return true; }
public boolean addDimensionIfNotExists(Dimension d) { if (immutable) throw new IllegalStateException("Cant modify"); if (findDimensionLocal(d.getShortName()) != null) return false; dimensions.add(d); d.setGroup(this); return true; }
private String addDimension(ucar.nc2.Group g, H5Group h5group, String name, int length, boolean isUnlimited) { int pos = name.lastIndexOf('/'); String dimName = (pos >= 0) ? name.substring(pos + 1) : name; Dimension d = h5group.dimMap.get(dimName); // first look in current group //if (d == null) // d = g.findDimension(dimName); // then look in parent groups LOOK if (d == null) { // create if not found d = new Dimension(dimName, length, true, isUnlimited, false); d.setGroup(g); h5group.dimMap.put(dimName, d); h5group.dimList.add(d); if (debugDimensionScales) debugOut.println("addDimension name=" + name + " dim= " + d + " to group " + g); } else { // check has correct length if (d.getLength() != length) throw new IllegalStateException("addDimension: DimScale has different length than dimension it references dimScale="+dimName); } return d.getShortName(); }
private String addDimension(ucar.nc2.Group g, H5Group h5group, String name, int length, boolean isUnlimited) { int pos = name.lastIndexOf('/'); String dimName = (pos >= 0) ? name.substring(pos + 1) : name; Dimension d = h5group.dimMap.get(dimName); // first look in current group //if (d == null) // d = g.findDimension(dimName); // then look in parent groups LOOK if (d == null) { // create if not found d = new Dimension(dimName, length, true, isUnlimited, false); d.setGroup(g); h5group.dimMap.put(dimName, d); h5group.dimList.add(d); if (debugDimensionScales) debugOut.println("addDimension name=" + name + " dim= " + d + " to group " + g); } else { // check has correct length if (d.getLength() != length) throw new IllegalStateException("addDimension: DimScale has different length than dimension it references dimScale=" + dimName); } return d.getShortName(); }
/** * Add a shared Dimension * * @param d add this Dimension */ public void addDimension(Dimension d) { if (immutable) throw new IllegalStateException("Cant modify"); if (findDimensionLocal(d.getShortName()) != null) throw new IllegalArgumentException("Dimension name (" + d.getShortName() + ") must be unique within Group " + getShortName()); dimensions.add(d); d.setGroup(this); }
private String addDimension(ucar.nc2.Group g, H5Group h5group, String name, int length, boolean isUnlimited) { int pos = name.lastIndexOf('/'); String dimName = (pos >= 0) ? name.substring(pos + 1) : name; Dimension d = h5group.dimMap.get(dimName); // first look in current group //if (d == null) // d = g.findDimension(dimName); // then look in parent groups LOOK if (d == null) { // create if not found d = new Dimension(dimName, length, true, isUnlimited, false); d.setGroup(g); h5group.dimMap.put(dimName, d); h5group.dimList.add(d); if (debugDimensionScales) { log.debug("addDimension name=" + name + " dim= " + d + " to group " + g); } } else { // check has correct length if (d.getLength() != length) throw new IllegalStateException("addDimension: DimScale has different length than dimension it references dimScale=" + dimName); } return d.getShortName(); }
/** * Add a shared Dimension * * @param d add this Dimension */ public void addDimension(Dimension d) { if (immutable) throw new IllegalStateException("Cant modify"); if (findDimensionLocal(d.getShortName()) != null) throw new IllegalArgumentException("Dimension name (" + d.getShortName() + ") must be unique within Group " + getShortName()); dimensions.add(d); d.setGroup(this); }
/** * Adds the specified shared dimension to this group, but only if another dimension with the same name doesn't * already exist. * * @param dim the dimension to add. * @return {@code true} if {@code dim} was successfully added to the group. Otherwise, {@code false} will be returned, * meaning that a dimension with {@code dim}'s name already exists within the group. * @throws IllegalStateException if this dimension is {@link #setImmutable() immutable}. * @throws IllegalArgumentException if {@code dim} isn't shared. */ public boolean addDimensionIfNotExists(Dimension dim) { if (immutable) throw new IllegalStateException("Cant modify"); if (!dim.isShared()) { throw new IllegalArgumentException("Dimensions added to a group must be shared."); } if (findDimensionLocal(dim.getShortName()) != null) return false; dimensions.add(dim); dim.setGroup(this); return true; }
/** * Adds the specified shared dimension to this group. * * @param dim the dimension to add. * @throws IllegalStateException if this dimension is {@link #setImmutable() immutable}. * @throws IllegalArgumentException if {@code dim} isn't shared or a dimension with {@code dim}'s name already * exists within the group. */ public void addDimension(Dimension dim) { if (immutable) throw new IllegalStateException("Cant modify"); if (!dim.isShared()) { throw new IllegalArgumentException("Dimensions added to a group must be shared."); } if (findDimensionLocal(dim.getShortName()) != null) throw new IllegalArgumentException("Dimension name (" + dim.getShortName() + ") must be unique within Group " + getShortName()); dimensions.add(dim); dim.setGroup(this); }
log.warn("Dimension "+name+" has size "+sizeS, ncfile.getLocation()); Dimension udim = new Dimension(name, 1); udim.setGroup(parent); unknownDims.add( udim); if (showWork) System.out.printf(" Add dimension %s %n", udim);
log.warn("Dimension {} has size {} {}", name,sizeS, ncfile.getLocation()); Dimension udim = new Dimension(name, 1); udim.setGroup(parent); unknownDims.add( udim); if (showWork) {
log.warn("Dimension {} has size {} {} ", sizeS, name, location); Dimension udim = new Dimension(name, 1); udim.setGroup(parent); unknownDims.add(udim); if (showWork) { log.debug(" Add dimension {}", udim); }
log.warn("Dimension {} has size {} {} ", new Object[] {sizeS, name, location}); Dimension udim = new Dimension(name, 1); udim.setGroup(parent); unknownDims.add( udim); if (showWork) System.out.printf(" Add dimension %s %n", udim);
log.warn("Dimension "+name+" has size "+sizeS, ncfile.getLocation()); Dimension udim = new Dimension(name, 1); udim.setGroup(parent); unknownDims.add( udim); if (showWork) System.out.printf(" Add dimension %s %n", udim);
log.warn("Dimension {} has size {} {} ", new Object[] {sizeS, name, location}); Dimension udim = new Dimension(name, 1); udim.setGroup(parent); unknownDims.add( udim); if (showWork) System.out.printf(" Add dimension %s %n", udim);