cdm/src/main/java/ucar/nc2/Variable.java
public void getNameAndDimensions(Formatter buf, boolean useFullName, boolean strict) {
    useFullName = useFullName && !strict;
    String name = useFullName ? getFullName() : getShortName();
    if (strict) name = NetcdfFile.makeValidCDLName(getShortName());
    buf.format("%s", name);

    if (shape != null) {
      if (getRank() > 0) buf.format("(");
      for (int i = 0; i < dimensions.size(); i++) {
        Dimension myd = dimensions.get(i);
        String dimName = myd.getShortName();
        if ((dimName != null) && strict)
          dimName = NetcdfFile.makeValidCDLName(dimName);
        if (i != 0) buf.format(", ");
        if (myd.isVariableLength()) {
          buf.format("*");
        } else if (myd.isShared()) {
          if (!strict)
            buf.format("%s=%d", dimName, myd.getLength());
          else
            buf.format("%s", dimName);
        } else {
          if (dimName != null) {
            buf.format("%s=", dimName);
          }
          buf.format("%d", myd.getLength());
        }
      }
      if (getRank() > 0) buf.format(")");
    }
  }
public void getNameAndDimensions(Formatter buf, boolean useFullName, boolean strict) {
    useFullName = useFullName && !strict;
    String name = useFullName ? getFullName() : getShortName();
    if (strict) name = NetcdfFile.makeValidCDLName(getShortName());
    buf.format("%s", name);

    if (shape != null) {
      if (getRank() > 0) buf.format("(");
      for (int i = 0; i < dimensions.size(); i++) {
        Dimension myd = dimensions.get(i);
        String dimName = myd.getShortName();
        if ((dimName != null) && strict)
          dimName = NetcdfFile.makeValidCDLName(dimName);
        if (i != 0) buf.format(", ");
        if (myd.isVariableLength()) {
          buf.format("*");
        } else if (myd.isShared()) {
          if (!strict)
            buf.format("%s=%d", dimName, myd.getLength());
          else
            buf.format("%s", dimName);
        } else {
          if (dimName != null) {
            buf.format("%s=", dimName);
          }
          buf.format("%d", myd.getLength());
        }
      }
      if (getRank() > 0) buf.format(")");
    }
  }
public void getNameAndDimensions ( Formatter buf , boolean useFullName , boolean strict ) { useFullName = useFullName && ! strict ; String name = useFullName ? getFullName ( ) : getShortName ( ) ; if ( strict ) name = NetcdfFile . makeValidCDLName ( getShortName ( ) ) ; buf . format ( "%s" , name ) ; if ( shape != null ) { if ( getRank ( ) > 0 ) buf . format ( "(" ) ; for ( int i = 0 ; i < dimensions . size ( ) ; i ++ ) { Dimension myd = dimensions . get ( i ) ; String dimName = myd . getShortName ( ) ; if ( ( dimName != null ) && strict ) dimName = NetcdfFile . makeValidCDLName ( dimName ) ; if ( i != 0 ) buf . format ( ", " ) ; if ( myd . isVariableLength ( ) ) { buf . format ( "*" ) ; } else if ( myd . isShared ( ) ) { if ( ! strict ) buf . format ( "%s=%d" , dimName , myd . getLength ( ) ) ; else buf . format ( "%s" , dimName ) ; } else { if ( dimName != null ) { buf . format ( "%s=" , dimName ) ; } buf . format ( "%d" , myd . getLength ( ) ) ; } } if ( getRank ( ) > 0 ) buf . format ( ")" ) ; } }
Add display name plus the dimensions to the StringBuffer

@param buf         add info to this
@param useFullName use full name else short name. strict = true implies short name
@param strict      strictly comply with ncgen syntax, with name escaping. otherwise, get extra info, no escaping
Add display name plus the dimensions to the StringBuffer