Sets a user defined attribute if the attribute with the specified key
is not set yet. This method is same with the following code except
that the operation is performed atomically.
<pre>
if (containsAttribute(key)) {
return getAttribute(key);
} else {
return setAttribute(key, value);
}
</pre>
@param key The key of the attribute we want to set
@param value The value we want to set
@return The old value of the attribute. <tt>null</tt> if not found.
Sets a user defined attribute if the attribute with the specified key is not set yet. This method is same with the following code except that the operation is performed atomically. <pre> if (containsAttribute(key)) { return getAttribute(key); } else { return setAttribute(key, value); } </pre>
@param key The key of the attribute we want to set @param value The value we want to set @return The old value of the attribute. <tt>null</tt> if not found.