@Override public Attribute clone() { return new Attribute(rawName, name, value); }
/** * Sets attribute value. Value may be <code>null</code>. */ public void setAttribute(String name, final String value) { initAttributes(); String rawAttributeName = name; if (!ownerDocument.config.isCaseSensitive()) { name = name.toLowerCase(); } // search if attribute with the same name exist for (int i = 0, attributesSize = attributes.size(); i < attributesSize; i++) { Attribute attr = attributes.get(i); if (attr.getName().equals(name)) { attr.setValue(value); return; } } attributes.add(new Attribute(rawAttributeName, name, value)); }
@Override public Attribute clone() { return new Attribute(rawName, name, value); }
@Override public Attribute clone() { return new Attribute(name, value, false); }
@Override public Attribute clone() { return new Attribute(rawName, name, value); }
/** * Sets attribute value. Value may be <code>null</code>. */ public void setAttribute(String name, String value) { initAttributes(); if (!caseSensitive) { name = name.toLowerCase(); } // search if attribute with the same name exist int nameHash = name.hashCode(); for (int i = 0, attributesSize = attributes.size(); i < attributesSize; i++) { Attribute attr = attributes.get(i); if (attr.equalsName(name, nameHash)) { attr.setValue(value); return; } } attributes.add(new Attribute(name, value, true)); }
/** * Sets attribute value. Value may be <code>null</code>. */ public void setAttribute(String name, final String value) { initAttributes(); String rawAttributeName = name; if (!ownerDocument.config.isCaseSensitive()) { name = name.toLowerCase(); } // search if attribute with the same name exist for (int i = 0, attributesSize = attributes.size(); i < attributesSize; i++) { Attribute attr = attributes.get(i); if (attr.getName().equals(name)) { attr.setValue(value); return; } } attributes.add(new Attribute(rawAttributeName, name, value)); }
/** * Sets attribute value. Value may be <code>null</code>. */ public void setAttribute(String name, String value) { initAttributes(); String rawAttributeName = name; if (!ownerDocument.config.isCaseSensitive()) { name = name.toLowerCase(); } // search if attribute with the same name exist for (int i = 0, attributesSize = attributes.size(); i < attributesSize; i++) { Attribute attr = attributes.get(i); if (attr.getName().equals(name)) { attr.setValue(value); return; } } attributes.add(new Attribute(rawAttributeName, name, value)); }