/** * Ensures that the list of attributes has the given size * * @param minCapacity DOCUMENT ME! */ public void ensureAttributesCapacity(int minCapacity) { if (minCapacity > 1) { List<Attribute> list = attributeList(); if (list instanceof ArrayList) { ArrayList<Attribute> arrayList = (ArrayList<Attribute>) list; arrayList.ensureCapacity(minCapacity); } } }
public Attribute attribute(int index) { return attributeList().get(index); }
public Iterator<Attribute> attributeIterator() { return attributeList().iterator(); }
public int attributeCount() { return attributeList().size(); }
public Attribute attribute(String name) { for (Attribute attribute : attributeList()) { if (name.equals(attribute.getName())) { return attribute; } } return null; }
public List<Attribute> attributes() { return new ContentListFacade<Attribute>(this, attributeList()); }
public String toString() { String uri = getNamespaceURI(); if ((uri != null) && (uri.length() > 0)) { if (VERBOSE_TOSTRING) { return super.toString() + " [Element: <" + getQualifiedName() + " uri: " + uri + " attributes: " + attributeList() + " content: " + contentList() + " />]"; } else { return super.toString() + " [Element: <" + getQualifiedName() + " uri: " + uri + " attributes: " + attributeList() + "/>]"; } } else { if (VERBOSE_TOSTRING) { return super.toString() + " [Element: <" + getQualifiedName() + " attributes: " + attributeList() + " content: " + contentList() + " />]"; } else { return super.toString() + " [Element: <" + getQualifiedName() + " attributes: " + attributeList() + "/>]"; } } }
public Attribute attribute(QName qName) { for (Attribute attribute : attributeList()) { if (qName.equals(attribute.getQName())) { return attribute; } } return null; }
public boolean remove(Attribute attribute) { List<Attribute> list = attributeList(); boolean answer = list.remove(attribute); if (answer) { childRemoved(attribute); } else { // we may have a copy of the attribute Attribute copy = attribute(attribute.getQName()); if (copy != null) { list.remove(copy); answer = true; } } return answer; }
List<Attribute> list = attributeList(size);
public void add(Attribute attribute) { if (attribute.getParent() != null) { String message = "The Attribute already has an existing parent \"" + attribute.getParent().getQualifiedName() + "\""; throw new IllegalAddException(this, attribute, message); } if (attribute.getValue() == null) { // try remove a previous attribute with the same // name since adding an attribute with a null value // is equivalent to removing it. Attribute oldAttribute = attribute(attribute.getQName()); if (oldAttribute != null) { remove(oldAttribute); } } else { attributeList().add(attribute); childAdded(attribute); } }
public Attribute attribute(String name) { for (Attribute attribute : attributeList()) { if (name.equals(attribute.getName())) { return attribute; } } return null; }
public Attribute attribute(String name) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (name.equals(attribute.getName())) { return attribute; } } return null; }
public Attribute attribute(String name) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (name.equals(attribute.getName())) { return attribute; } } return null; }
public Attribute attribute(String name) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (name.equals(attribute.getName())) { return attribute; } } return null; }
public Attribute attribute(QName qName) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (qName.equals(attribute.getQName())) { return attribute; } } return null; }
public Attribute attribute(QName qName) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (qName.equals(attribute.getQName())) { return attribute; } } return null; }
public Attribute attribute(QName qName) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (qName.equals(attribute.getQName())) { return attribute; } } return null; }
public Attribute attribute(QName qName) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (qName.equals(attribute.getQName())) { return attribute; } } return null; }
public Attribute attribute(QName qName) { for (Attribute attribute : attributeList()) { if (qName.equals(attribute.getQName())) { return attribute; } } return null; }