public Attribute renameVariableAttribute ( String varName , String attName , String newName ) { if ( ! defineMode ) throw new UnsupportedOperationException ( "not in define mode" ) ; Variable v = findVariable ( varName ) ; if ( v == null ) return null ; Attribute att = v . findAttribute ( attName ) ; if ( null == att ) return null ; v . remove ( att ) ; att = new Attribute ( newName , att . getValues ( ) ) ; v . addAttribute ( att ) ; return att ; }
Rename a variable Attribute . Must be in define mode .