Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java
PREV | NEXT | SHOW LISTS | HIDE LISTS |

# Class com.ibm.xml.parser.TXAttributeList

    java.lang.Object
        |
        +----java.util.Vector
                |
                +----com.ibm.xml.parser.TXAttributeList

public class TXAttributeList
extends java.util.Vector
implements AttributeList, java.lang.Cloneable, java.io.Serializable

The TXAttributeList class implements the AttributeList interface as defined by the Document Object Model (DOM).

AttributeLists are used to represent collections of Attributes which can be accessed by name or by ordinal. In most cases, AttributeLists are created from Element objects.

Version:
  1.1
See Also:
  AttributeList

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData

Constructor Summary
TXAttributeList() Constructor.

Method Summary
void | clear() Removes all Attributes from this AttributeList.
java.lang.Object | clone() Clone this TXAttributeList using the appropriate factory.
Attribute | getAttribute(java.lang.String name) Returns an Attribute instance whose name matches the specified name.
ElementFactory | getFactory() Returns the factory used for creating this Node.
int | getLength() Returns the number of Attributes in this AttributeList.
int | indexOf(java.lang.String name) Returns the index of the Attribute whose name matches the specified name.
Attribute | item(int index) Returns the Attribute at the specified index.
TXAttribute[] | makeArray() Returns all Attributes in this list as an array of TXAttributes.
Attribute | remove(java.lang.String name) Removes the Attribute instance specified by name from this list and returns it.
Attribute | setAttribute(Attribute attribute) Adds or replaces an Attribute.
void | setFactory(ElementFactory factory) Sets the factory to be used in creating this Node.
void | setParent(Element parent) Sets this AttributeList and all its Child Attributes to have the specified parent Node.

Methods inherited from class java.util.Vector
addElement, capacity, clone, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toString, trimToSize

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

### TXAttributeList

    public TXAttributeList()

  Constructor.

Method Detail

### clone

    public java.lang.Object clone()

  Clone this TXAttributeList using the appropriate factory. Note that this method does clone Child Attributes.
  Returns:
    Cloned TXAttributeList and children.
  Overrides:
    clone in class java.util.Vector

### getFactory

    public ElementFactory getFactory()

  Returns the factory used for creating this Node.
  Returns:
    The factory used for creating this Node, or null if no factory.
  See Also:
    setFactory

### setFactory

    public void setFactory(ElementFactory factory)

  Sets the factory to be used in creating this Node.
  Parameters:
    `factory` - The factory to be used in creating this Node.
  See Also:
    getFactory

### indexOf

    public int indexOf(java.lang.String name)

  Returns the index of the Attribute whose name matches the specified name.
  Parameters:
    `name` - Name to match against in the AttributeList.
  Returns:
    0-based index of matching Attribute, or -1 if no matches.
  See Also:
    getAttribute

### getAttribute

    public Attribute getAttribute(java.lang.String name)

  Returns an Attribute instance whose name matches the specified name.

  This method is defined by DOM.

  Implements:
    getAttribute in interface AttributeList
  Parameters:
    `name` - Name to match against in the AttributeList.
  Returns:
    The matching Attribute instance, or null if no matches.
  See Also:
    indexOf, setAttribute

### setAttribute

    public Attribute setAttribute(Attribute attribute)

  Adds or replaces an Attribute. If the Attribute name already exists in this list, the previous Attribute is replaced, and returned. If no Attribute of the same name exists null is returned, and the specified attribute is added to the end of this AttributeList.

  This method is defined by DOM.

  Implements:
    setAttribute in interface AttributeList
  Parameters:
    `attribute` - The Attribute to add or replace.
  Returns:
    If replaced, the Attribute that was replaced; otherwise, null.
  See Also:
    getAttribute, remove

### remove

    public Attribute remove(java.lang.String name) throws NoSuchNodeException

  Removes the Attribute instance specified by name from this list and returns it. If the name provided does not exist, the NoSuchAttributeException is thrown.

  This method is defined by DOM.

  Implements:
    remove in interface AttributeList
  Parameters:
    `name` - Name to match against in the AttributeList.
  Returns:
    The matching Attribute instance that was removed.
  Throws:
    NoSuchNodeException - Thrown if no matching Attribute name can be found in the list.
  See Also:
    setAttribute, clear

### clear

    public void clear()

  Removes all Attributes from this AttributeList.
  See Also:
    remove

### item

    public Attribute item(int index)

  Returns the Attribute at the specified index. If the specified index is greater than or equal to the number of Nodes in this list, a NoSuchAttributeException exception is thrown.

  This method is defined by DOM.

  Implements:
    item in interface AttributeList
  Parameters:
    `index` - 0-based index which identifies the Attribute to return.
  Returns:
    The Attribute at the specified index.
  Throws:
    NoSuchNodeException - Thrown if the specified index is invalid.

### getLength

    public int getLength()

  Returns the number of Attributes in this AttributeList.

  This method is defined by DOM.

  Implements:
    getLength in interface AttributeList
  Returns:
    The number of Attributes in this list.

### setParent

    public void setParent(Element parent)

  Sets this AttributeList and all its Child Attributes to have the specified parent Node.
  Parameters:
    `parent` - The Parent for this AttributeList and its child Attributes.

### makeArray

    public TXAttribute[] makeArray()

  Returns all Attributes in this list as an array of TXAttributes.
  Returns:
    All Attributes in this list.

Contents | Package | Class | Tree | Deprecated | Index | Help |
PREV | NEXT | SHOW LISTS | HIDE LISTS |