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; }
return group.findDimensionLocal(dimShortName);
/** * 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); }
/** * 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); }
/** * Retrieve a Dimension using its (short) name. If it doesnt exist in this group, * recursively look in parent groups. * * @param name Dimension name. * @return the Dimension, or null if not found */ public Dimension findDimension(String name) { if (name == null) return null; // name = NetcdfFile.makeNameUnescaped(name); Dimension d = findDimensionLocal(name); if (d != null) return d; Group parent = getParentGroup(); if (parent != null) return parent.findDimension(name); return null; }
/** * Retrieve a Dimension using its (short) name. If it doesnt exist in this group, * recursively look in parent groups. * * @param name Dimension name. * @return the Dimension, or null if not found */ public Dimension findDimension(String name) { if (name == null) return null; // name = NetcdfFile.makeNameUnescaped(name); Dimension d = findDimensionLocal(name); if (d != null) return d; Group parent = getParentGroup(); if (parent != null) return parent.findDimension(name); return null; }
/** * Retrieve a Dimension using its (short) name. If it doesnt exist in this group, * recursively look in parent groups. * * @param name Dimension name. * @return the Dimension, or null if not found */ public Dimension findDimension(String name) { if (name == null) return null; // name = NetcdfFile.makeNameUnescaped(name); Dimension d = findDimensionLocal(name); if (d != null) return d; Group parent = getParentGroup(); if (parent != null) return parent.findDimension(name); return null; }
/** * 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); }
private static boolean checkGroup(Group g) { Variable crs = g.findVariable(HdfEos.HDFEOS_CRS); Group dataG = g.findGroup(DATA_GROUP); if (crs != null && dataG != null) { Attribute att = crs.findAttribute(HdfEos.HDFEOS_CRS_Projection); if (att == null) return false; if (!att.getStringValue().equals("GCTP_SNSOID") && !att.getStringValue().equals("GCTP_GEO")) return false; return !(dataG.findDimensionLocal(DIMX_NAME) == null || dataG.findDimensionLocal(DIMY_NAME) == null); } for (Group ng : g.getGroups()) { if (checkGroup(ng)) return true; } return false; }
private static boolean checkGroup(Group g) { Variable crs = g.findVariable(HdfEos.HDFEOS_CRS); Group dataG = g.findGroup(DATA_GROUP); if (crs != null && dataG != null) { Attribute att = crs.findAttribute(HdfEos.HDFEOS_CRS_Projection); if (att == null) return false; if (!att.getStringValue().equals("GCTP_SNSOID") && !att.getStringValue().equals("GCTP_GEO")) return false; return !(dataG.findDimensionLocal(DIMX_NAME) == null || dataG.findDimensionLocal(DIMY_NAME) == null); } for (Group ng : g.getGroups()) { if (checkGroup(ng)) return true; } return false; }
private static boolean checkGroup(Group g) { Variable crs = g.findVariable(HdfEos.HDFEOS_CRS); Group dataG = g.findGroup(DATA_GROUP); if (crs != null && dataG != null) { Attribute att = crs.findAttribute(HdfEos.HDFEOS_CRS_Projection); if (att == null) return false; if (!att.getStringValue().equals("GCTP_SNSOID") && !att.getStringValue().equals("GCTP_GEO")) return false; if (dataG.findDimensionLocal(DIMX_NAME) == null || dataG.findDimensionLocal(DIMY_NAME) == null) return false; return true; } for (Group ng : g.getGroups()) { if (checkGroup(ng)) return true; } return false; }
Group dataG = g.findGroup(DATA_GROUP); if (dataG != null) { dimX = dataG.findDimensionLocal(DIMX_NAME); dimY = dataG.findDimensionLocal(DIMY_NAME);
if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), unlimitedOK && d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd);
if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), unlimitedOK && d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd);
if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), unlimitedOK && d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd);
if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd);
if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd);
if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd);