/** * * @return the # of contained attributes */ public int size() { return (_attr == null ? 0 : _attr.size()); }
/** * 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; }
/** * 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; }