public void replace(Attr attr){
  int index=indexOf(attr.getName());
  if (index != -1) {
    _attrs.set(index,attr);
  }
 else {
    _attrs.add(attr);
  }
}

public void replace ( Attr attr ) { int index = indexOf ( attr . getName ( ) ) ; if ( index != - 1 ) { _attrs . set ( index , attr ) ; } else { _attrs . add ( attr ) ; } }
replace an existing attribute .
