/** * 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; }
/** * 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); }
_attr.put(alias, newAlias);
/** * 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); }
_attr.put(alias, newAlias);
/** * Returns a clone of this <code>AttributeTable</code>. * See DAPNode.cloneDag() * * @param map track previously cloned nodes * @return a clone of this <code>Attribute</code>. */ public DAPNode cloneDAG(CloneMap map) throws CloneNotSupportedException { AttributeTable at = (AttributeTable) super.cloneDAG(map); at._attr = new SortedTable(); for (int i = 0; i < _attr.size(); i++) { String key = (String) _attr.getKey(i); Attribute element = (Attribute) _attr.elementAt(i); // clone element (don't clone key because it's a read-only String) at._attr.put(key, (Attribute)cloneDAG(map,element)); } return at; }
_attr.put(clearname, a);
/** * Returns a clone of this <code>AttributeTable</code>. * See DAPNode.cloneDag() * * @param map track previously cloned nodes * @return a clone of this <code>Attribute</code>. */ public DAPNode cloneDAG(CloneMap map) throws CloneNotSupportedException { AttributeTable at = (AttributeTable) super.cloneDAG(map); at._attr = new SortedTable(); for (int i = 0; i < _attr.size(); i++) { String key = (String) _attr.getKey(i); Attribute element = (Attribute) _attr.elementAt(i); // clone element (don't clone key because it's a read-only String) at._attr.put(key, (Attribute)cloneDAG(map,element)); } return at; }
_attr.put(name, a);