/** * Sets the attribute with the given name to the given string value. <p>A new attribute with * <code>ProductData.TYPE_ASCII</code> is added to this node if an attribute with the given name could not be found * in this node. * * @param name the attribute name * @param value the new value */ public void setAttributeString(String name, String value) { final MetadataAttribute attribute = getAndMaybeCreateAttribute(name, ProductData.TYPE_ASCII, 1); attribute.getData().setElems(value); attribute.fireProductNodeDataChanged(); setModified(true); }
/** * Sets the attribute with the given name to the given integer value. <p>A new attribute with * <code>ProductData.TYPE_INT32</code> is added to this node if an attribute with the given name could not be found * in this node. * * @param name the attribute name * @param value the new value */ public void setAttributeInt(String name, int value) { final MetadataAttribute attribute = getAndMaybeCreateAttribute(name, ProductData.TYPE_INT32, 1); attribute.getData().setElemInt(value); attribute.fireProductNodeDataChanged(); setModified(true); }
/** * Sets the attribute with the given name to the given double value. <p>A new attribute with * <code>ProductData.TYPE_FLOAT64</code> is added to this node if an attribute with the given name could not be found * in this node. * * @param name the attribute name * @param value the new value */ public void setAttributeDouble(String name, double value) { final MetadataAttribute attribute = getAndMaybeCreateAttribute(name, ProductData.TYPE_FLOAT64, 1); attribute.getData().setElemDouble(value); attribute.fireProductNodeDataChanged(); setModified(true); }
/** * Sets the attribute with the given name to the given utc value. <p>A new attribute with * <code>ProductData.UTC</code> is added to this node if an attribute with the given name could not be found * in this node. * * @param name the attribute name * @param value the new value */ public void setAttributeUTC(String name, ProductData.UTC value) { final MetadataAttribute attribute = getAndMaybeCreateAttribute(name, ProductData.TYPE_UTC, 1); attribute.getData().setElems(value.getArray()); attribute.fireProductNodeDataChanged(); setModified(true); }