public Variable addVariable ( Group g , String shortName , DataType dtype , String dims ) { if ( immutable ) throw new IllegalStateException ( "Cant modify" ) ; if ( g == null ) g = rootGroup ; Variable v = new Variable ( this , g , null , shortName ) ; v . setDataType ( dtype ) ; v . setDimensions ( dims ) ; g . addVariable ( v ) ; return v ; }
Create a new Variable and add to the given group .