private void setStringValue ( String val ) { if ( val == null ) throw new IllegalArgumentException ( "Attribute value cannot be null" ) ; // get rid of trailing nul characters int len = val . length ( ) ; while ( ( len > 0 ) && ( val . charAt ( len - 1 ) == 0 ) ) len -- ; if ( len != val . length ( ) ) val = val . substring ( 0 , len ) ; this . svalue = val ; this . nelems = 1 ; this . dataType = DataType . STRING ; //values = Array.factory(String.class, new int[]{1}); //values.setObject(values.getIndex(), val); //setValues(values); }
set the value as a String trimming trailing zeroes