code: private void sortAttributes(final String[] names, final Vector wanted_attr,
  	    final Vector wanted_w_attr) throws DevFailed {
  	for (final String name : names) {
  	    final Attribute att = dev_attr.get_attr_by_name(name);
  	    final int att_idx = dev_attr.get_attr_ind_by_name(name);
  
  	    if (att.get_writable() == AttrWriteType.READ_WRITE) {
  		wanted_w_attr.addElement(att_idx);
  		wanted_attr.addElement(att_idx);
  		att.waitEndOfRead(); // Wait a while if already reading
  	    } else if (att.get_writable() == AttrWriteType.WRITE) {
  		wanted_w_attr.addElement(att_idx);
  	    } else {
  		// READ or READ_WITH_WRITE
  		wanted_attr.addElement(att_idx);
  		att.waitEndOfRead(); // Wait a while if already reading
  	    }
  	}
      }
docs: =========================================================================