/** * Returns the <code>Attribute</code> which matches name. * * @param clearname the name of the <code>Attribute</code> to return. * @return the <code>Attribute</code> with the specified name, or null * if there is no matching <code>Attribute</code>. * @see Attribute */ public final Attribute getAttribute(String clearname) { //throws NoSuchAttributeException { Attribute a = (Attribute) _attr.get(clearname); return (a); }
/** * Returns the <code>Attribute</code> which matches name. * * @param name the name of the <code>Attribute</code> to return. * @return True if an Attribute with named 'name' exists, False otherwise. * @see Attribute */ public final boolean hasAttribute(String name) { Attribute a = (Attribute) _attr.get(name); if (a == null) { return (false); } return (true); }
/** * Returns the <code>Attribute</code> which matches name. * * @param clearname the name of the <code>Attribute</code> to return. * @return True if an Attribute with named 'name' exists, False otherwise. * @see Attribute */ public final boolean hasAttribute(String clearname) { Attribute a = (Attribute) _attr.get(clearname); if (a == null) { return (false); } return (true); }
/** * Returns the <code>Attribute</code> which matches name. * * @param name the name of the <code>Attribute</code> to return. * @return the <code>Attribute</code> with the specified name, or null * if there is no matching <code>Attribute</code>. * @see Attribute */ public final Attribute getAttribute(String name) { //throws NoSuchAttributeException { Attribute a = (Attribute) _attr.get(name); // if(a == null){ // throw new NoSuchAttributeException("There is no Attribute named '" + name + "' "+ // "in the AttributeTable '" + getName() + "'"); // } return (a); }
/** * Create and append an attribute container to the table. * A container is another <code>AttributeTable</code> object. * * @param name the name of the container to add. * @return A pointer to the new <code>AttributeTable</code> object, or null * if a container by that name already exists. */ public final AttributeTable appendContainer(String name) { // return null if name already exists // FIXME! THIS SHOULD RETURN AN EXCEPTION! if (_attr.get(name) != null) return null; AttributeTable at = new AttributeTable(name); Attribute a = new Attribute(name, at); _attr.put(name, a); return at; }
/** * Create and append an attribute container to the table. * A container is another <code>AttributeTable</code> object. * * @param clearname the name of the container to add. * @return A pointer to the new <code>AttributeTable</code> object, or null * if a container by that name already exists. */ public final AttributeTable appendContainer(String clearname) { // return null if clearname already exists // FIXME! THIS SHOULD RETURN AN EXCEPTION! if (_attr.get(clearname) != null) return null; AttributeTable at = new AttributeTable(clearname); Attribute a = new Attribute(clearname, at); _attr.put(clearname, a); return at; }
if (_attr.get(alias) != null) { throw new AttributeExistsException("Could not alias `" + alias + "' to `" + attributeName + "'. " +
/** * Create and append an attribute container to the table. * A container is another <code>AttributeTable</code> object. * * @param clearname the name of the container to add. * if a container by that name already exists. */ public final void addContainer(String clearname, AttributeTable at) throws AttributeExistsException { // return null if name already exists if (_attr.get(clearname) != null) { throw new AttributeExistsException("The Attribute '" + clearname + "' already exists in the container '" + getEncodedName() + "'"); } Attribute a = new Attribute(clearname, at); _attr.put(clearname, a); }
/** * Create and append an attribute container to the table. * A container is another <code>AttributeTable</code> object. * * @param name the name of the container to add. * if a container by that name already exists. */ public final void addContainer(String name, AttributeTable at) throws AttributeExistsException { // return null if name already exists if (_attr.get(name) != null) { throw new AttributeExistsException("The Attribute '" + name + "' already exists in the container '" + getName() + "'"); } Attribute a = new Attribute(name, at); _attr.put(name, a); }
if (_attr.get(alias) != null) { throw new AttributeExistsException("Could not alias `" + alias + "' to `" + attributeName + "'. " +
/** * Delete the attribute named <code>name</code>. If the attribute has a * vector value, delete the <code>i</code>'th element of the vector. * * @param name The name of the attribute to delete. This can be an * attribute of any type, including containers. * @param i If the named attribute is a vector, and <code>i</code> is * non-negative, the <code>i</code>'th entry in the vector is deleted. * If <code>i</code> equals -1, the entire attribute is deleted. * @see AttributeTable#delAttribute(String) */ public final void delAttribute(String name, int i) throws DASException { if (i == -1) { // delete the whole attribute _attr.remove(name); } else { Attribute a = (Attribute) _attr.get(name); if (a != null) { if (a.isContainer()) { _attr.remove(name); // delete the entire container } else { a.deleteValueAt(i); } } } }
/** * Delete the attribute named <code>name</code>. If the attribute has a * vector value, delete the <code>i</code>'th element of the vector. * * @param clearname The name of the attribute to delete. This can be an * attribute of any type, including containers. * @param i If the named attribute is a vector, and <code>i</code> is * non-negative, the <code>i</code>'th entry in the vector is deleted. * If <code>i</code> equals -1, the entire attribute is deleted. * @see AttributeTable#delAttribute(String) */ public final void delAttribute(String clearname, int i) throws DASException { if (i == -1) { // delete the whole attribute _attr.remove(clearname); } else { Attribute a = (Attribute) _attr.get(clearname); if (a != null) { if (a.isContainer()) { _attr.remove(clearname); // delete the entire container } else { a.deleteValueAt(i); } } } }
boolean check) throws DASException { Attribute a = (Attribute) _attr.get(clearname);
boolean check) throws DASException { Attribute a = (Attribute) _attr.get(name);