protected String toValString(Set vals){
  StringBuilder sb=new StringBuilder();
  boolean first=true;
  for (Iterator i=vals.iterator(); i.hasNext(); ) {
    String val=(String)i.next();
    val=encodeVal(val);
    if (first) {
      first=false;
    }
 else {
      sb.append(',');
    }
    sb.append(val);
  }
  return sb.toString();
}

protected String toValString ( Set vals ) { StringBuilder sb = new StringBuilder ( ) ; boolean first = true ; for ( Iterator i = vals . iterator ( ) ; i . hasNext ( ) ; ) { String val = ( String ) i . next ( ) ; val = encodeVal ( val ) ; if ( first ) { first = false ; } else { sb . append ( ',' ) ; } sb . append ( val ) ; } return sb . toString ( ) ; }
converts a set of values for an attribute into a string , encoding special characters in the values as necessary .
