cdm/src/main/java/ucar/nc2/NetcdfFile.java
public Dimension findDimension(String fullName) {
    if (fullName == null || fullName.isEmpty()) {
      return null;
    }

    Group group = rootGroup;
    String dimShortName = fullName;

    // break into group/group and dim
    int pos = fullName.lastIndexOf('/');
    if (pos >= 0) {
      String groups = fullName.substring(0, pos);
      dimShortName = fullName.substring(pos + 1);

      StringTokenizer stoke = new StringTokenizer(groups, "/");
      while (stoke.hasMoreTokens()) {
        String token = NetcdfFile.makeNameUnescaped(stoke.nextToken());
        group = group.findGroup(token);

        if (group == null) {
          return null;
        }
      }
    }

    return group.findDimensionLocal(dimShortName);
  }
public Dimension findDimension(String fullName) {
    if (fullName == null || fullName.isEmpty()) {
      return null;
    }

    Group group = rootGroup;
    String dimShortName = fullName;

    // break into group/group and dim
    int pos = fullName.lastIndexOf('/');
    if (pos >= 0) {
      String groups = fullName.substring(0, pos);
      dimShortName = fullName.substring(pos + 1);

      StringTokenizer stoke = new StringTokenizer(groups, "/");
      while (stoke.hasMoreTokens()) {
        String token = NetcdfFile.makeNameUnescaped(stoke.nextToken());
        group = group.findGroup(token);

        if (group == null) {
          return null;
        }
      }
    }

    return group.findDimensionLocal(dimShortName);
  }
public Dimension findDimension ( String fullName ) { if ( fullName == null || fullName . isEmpty ( ) ) { return null ; } Group group = rootGroup ; String dimShortName = fullName ; // break into group/group and dim int pos = fullName . lastIndexOf ( ' ' ) ; if ( pos >= 0 ) { String groups = fullName . substring ( 0 , pos ) ; dimShortName = fullName . substring ( pos + 1 ) ; StringTokenizer stoke = new StringTokenizer ( groups , "/" ) ; while ( stoke . hasMoreTokens ( ) ) { String token = NetcdfFile . makeNameUnescaped ( stoke . nextToken ( ) ) ; group = group . findGroup ( token ) ; if ( group == null ) { return null ; } } } return group . findDimensionLocal ( dimShortName ) ; }
Finds a Dimension with the specified full name. It may be nested in multiple groups.
An embedded "/" is interpreted as a group separator. A leading slash indicates the root group. That slash may be
omitted, but the {@code fullName} will be treated as if it were there. In other words, the first name token in
{@code fullName} is treated as the short name of a Group or Dimension, relative to the root group.

@param fullName  Dimension full name, e.g. "/group/subgroup/dim".
@return  the Dimension or {@code null} if it wasn't found.
Finds a Dimension with the specified full name . It may be nested in multiple groups . An embedded / is interpreted as a group separator . A leading slash indicates the root group . That slash may be omitted but the { @code fullName } will be treated as if it were there . In other words the first name token in { @code fullName } is treated as the short name of a Group or Dimension relative to the root group .