Example #1
0
  @Override
  public void getNameAndDimensions(StringBuffer buf, boolean useFullName, boolean showDimLength) {
    useFullName = useFullName && !showDimLength;
    String name = useFullName ? getName() : getShortName();
    buf.append(name);

    if (getRank() > 0) buf.append("(");
    for (int i = 0; i < dimensions.size(); i++) {
      DimOrder dim = dimensions.get(i);
      IDimension myd = dim.dimension;
      String dimName = myd.getName();
      if ((dimName == null) || !showDimLength) dimName = "";

      if (i != 0) buf.append(", ");

      if (myd.isVariableLength()) {
        buf.append("*");
      } else if (myd.isShared()) {
        if (!showDimLength) buf.append(dimName + "=" + myd.getLength());
        else buf.append(dimName);
      } else {
        if (dimName != null) {
          buf.append(dimName);
        }
        buf.append(myd.getLength());
      }
    }

    if (getRank() > 0) buf.append(")");
  }
Example #2
0
 @Override
 public int compareTo(Object o) {
   IDimension dim = (IDimension) o;
   return longName.compareTo(dim.getName());
 }