[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

generating CDL for variable declarations from Java



Bob,

I wrote:

> To get its type, use 
> 
>   ncvar.getComponentType()
> 
> which returns a Class whose toString() method can be used for the type
> string.

Oops, that should have been 

   ncvar.getElementType()

> This is all done in a private method in the source for
> ucar.nc2.Variable:

I should have instead pointed to:

  private void getFullName(StringBuffer buf) {
    buf.append(getElementType());
    buf.append(" ");
    buf.append(getName());
    if (getRank() > 0) buf.append("(");
    for (int i=0; i<dimensions.size(); i++) {
      Dimension myd = (Dimension) dimensions.get(i);
      if (i!=0)
        buf.append(", ");
      buf.append( myd.getName() );
    }
    if (getRank() > 0) buf.append(")");
    buf.append(";");
  }
 
--Russ