opendap/src/main/java/opendap/dap/AttributeTable.java
public final void appendAttribute(String clearname, int type, String value,
                                      boolean check) throws DASException {

        Attribute a = (Attribute) _attr.get(clearname);

        if (a != null && (type != a.getType())) {

            // type mismatch error
            throw new AttributeExistsException("The Attribute `" + clearname
                    + "' was previously defined with a different type.");

        } else if (a != null) {

            a.appendValue(value, check);

        } else {

            a = new Attribute(type, clearname, value, check);
            _attr.put(clearname, a);
        }
    }
public final void appendAttribute(String clearname, int type, String value,
                                      boolean check) throws DASException {

        Attribute a = (Attribute) _attr.get(clearname);

        if (a != null && (type != a.getType())) {

            // type mismatch error
            throw new AttributeExistsException("The Attribute `" + clearname
                    + "' was previously defined with a different type.");

        } else if (a != null) {

            a.appendValue(value, check);

        } else {

            a = new Attribute(type, clearname, value, check);
            _attr.put(clearname, a);
        }
    }
Adds an attribute to the table.  If the given name already
refers to an attribute, and the attribute has a vector value,
the given value is appended to the attribute vector.  Calling
this function repeatedly is the way to create an attribute
vector.
<p/>
The function throws an exception if the attribute is a
container, or if the type of the input value does not match the
existing attribute's type and the <code>check</code> parameter
is true.  Use the <code>appendContainer</code> method to add container
attributes.

@param clearname  The name of the attribute to add or modify.
@param type  The type code of the attribute to add or modify.
@param value The value to add to the attribute table.
@param check Check the validity of the attribute's value?
@throws AttributeExistsException   thrown if an Attribute with the same
name, but a different type was previously defined.
@throws AttributeBadValueException thrown if the value is not a legal
member of type
@see AttributeTable#appendContainer(String)