Copy an entire Attributes object.

<p>It may be more efficient to reuse an existing object
rather than constantly allocating new ones.</p>

@param atts The attributes to copy.
323996
public void setAttributes (Attributes atts)
    {
        clear();
        length = atts.getLength();
        if (length > 0) {
            data = new String[length*5];
            for (int i = 0; i < length; i++) {
                data[i*5] = atts.getURI(i);
                data[i*5+1] = atts.getLocalName(i);
                data[i*5+2] = atts.getQName(i);
                data[i*5+3] = atts.getType(i);
                data[i*5+4] = atts.getValue(i);
            }
    }
    }
875861
public void setDeviceAttributes(java.util.Collection<AttributeType> deviceAttributes) {
        if (deviceAttributes == null) {
            this.deviceAttributes = null;
            return;
        }

        this.deviceAttributes = new java.util.ArrayList<AttributeType>(deviceAttributes);
    }
299017
public void copyAttributes(File file, File copy, AttributeCopyOption copyOption) {
    switch (copyOption) {
      case ALL:
        file.copyAttributes(copy);
        break;
      case BASIC:
        file.copyBasicAttributes(copy);
        break;
      default:
        // don't copy
    }
  }
900298
void copyTo(byte[] dest, int destOffset) {
        System.arraycopy(array,offset,dest,destOffset,length());
    }
857502
private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) {
    if (attrName == null) {
      throw new IllegalArgumentException("attrName");
    }
    if (attrValue != null) {
      attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue);
    }
  }
270421
public void setAttributes(java.util.Collection<AttributeNameAndValue> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<AttributeNameAndValue>(attributes);
    }
1121943
@Override
    public void setAttributes(final Map<String, List<Object>> attributes) {
        for (final IAdditionalDescriptors additionalDescriptors : delegateDescriptors) {
            additionalDescriptors.setAttributes(attributes);
        }
    }
306464
@Override
    public void setAttributes(Map<String, List<String>> attributes) {
        // Tries to modify as many of the existing attributes in place to reduce DB churn in
        // hibernate

        // Make a local copy so we don't edit the original reference
        attributes = new LinkedHashMap<String, List<String>>(attributes);

        for (final Iterator<LocalAccountPersonAttributeImpl> attributesItr =
                        this.attributes.iterator();
                attributesItr.hasNext(); ) {
            final LocalAccountPersonAttributeImpl attribute = attributesItr.next();

            // Remove the new values for the attribute from the input map
            final String name = attribute.getName();
            final List<String> newValues = attributes.remove(name);

            // If no new values remove the attribute
            if (newValues == null) {
                attributesItr.remove();
            }
            // Otherwise update the existing values
            else {
                attribute.setValues(new ArrayList<String>(newValues));
            }
        }

        // Add any remaining new attributes to the list
        for (final Map.Entry<String, List<String>> attribute : attributes.entrySet()) {
            final String name = attribute.getKey();
            final List<String> values = attribute.getValue();
            this.attributes.add(new LocalAccountPersonAttributeImpl(name, values));
        }
    }
744948
public static void copyAttributes(Map<String, String> source, Element dest) {
        for (Entry<String, String> entry : source.entrySet()) {
            dest.setAttribute(entry.getKey(), entry.getValue());
        }
    }
497053
public GetContactAttributesResult withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
387856
public int copy(byte[] bytes, int at) {
        System.arraycopy(this.bytes, 0, bytes, at, this.length);
        return at + this.length;
    }
995207
public void setAttributes(java.util.Collection<TargetGroupAttribute> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<TargetGroupAttribute>(attributes);
    }
1161769
public void setAttribute(String attrname, String value) {
        if (attributes == null)
            attributes = new ArrayList<Attribute>();
        Attribute.setAttribute(attributes, attrname, value);
    }
1233651
public void setAttributes(java.util.Collection<Value> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<Value>(attributes);
    }
359651
public void setAttributes(java.util.Collection<String> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<String>(attributes);
    }
1166624
private Attributes toAttributes(Map<String,String> attrs){
        AttributesImpl impl = new AttributesImpl();
        for (Map.Entry<String,String> attr : attrs.entrySet()){
        	impl.addAttribute("", attr.getKey(), "", "CDATA", attr.getValue());
        }
        return impl;
    }
1013446
public void setAttributeNames(java.util.Collection<String> attributeNames) {
        if (attributeNames == null) {
            this.attributeNames = null;
            return;
        }

        this.attributeNames = new java.util.ArrayList<String>(attributeNames);
    }