void printDimrefs ( DapVariable var ) throws DapException { if ( var . getRank ( ) == 0 ) return ; List < DapDimension > dimset = this . ce . getConstrainedDimensions ( var ) ; if ( dimset == null ) throw new DapException ( "Unknown variable: " + var ) ; assert var . getRank ( ) == dimset . size ( ) ; for ( int i = 0 ; i < var . getRank ( ) ; i ++ ) { DapDimension dim = dimset . get ( i ) ; printer . marginPrint ( "<Dim" ) ; if ( dim . isShared ( ) ) { String fqn = dim . getFQN ( ) ; assert ( fqn != null ) : "Illegal Dimension reference" ; fqn = fqnXMLEscape ( fqn ) ; printXMLAttribute ( "name" , fqn , XMLESCAPED ) ; } else { long size = dim . getSize ( ) ; // the size for printing purposes printXMLAttribute ( "size" , Long . toString ( size ) , NILFLAGS ) ; } printer . println ( "/>" ) ; } }
Print the dimrefs for a variable s dimensions . If the variable has a non - whole projection then use size else use the dimension name .