org.exolab.adaptx.xml

Class AttributeListImpl

public class AttributeListImpl extends Object implements AttributeList

my own implementation of the SAX AttributeList

Version: $Revision: 3633 $ $Date: 2003-03-01 02:38:44 -0500 (Sat, 01 Mar 2003) $

Author: Keith Visco

Constructor Summary
AttributeListImpl()
AttributeListImpl(int size)
Method Summary
voidaddAttribute(String name, String value)
voidclear()
Removes all attribute mappings from this AttributeList
intgetLength()
Returns the number of attributes in the list.
StringgetName(int i)
Returns the name of the attribute at the given index.
StringgetType(int i)
Returns the type of the attribute at the specified index.
StringgetType(String name)
Return the type of the attribute with the given name.
StringgetValue(int i)
Return the value of the attribute at the specified index
StringgetValue(String name)
Get the value of an attribute (by name).
voidremove(int index)
Removes the name-value pair at the given index
voidremove(String name)
Removes the name and it's associated value from this AttributeList

Constructor Detail

AttributeListImpl

public AttributeListImpl()

AttributeListImpl

public AttributeListImpl(int size)

Method Detail

addAttribute

public void addAttribute(String name, String value)

clear

public void clear()
Removes all attribute mappings from this AttributeList

getLength

public int getLength()
Returns the number of attributes in the list.

Returns: The number of attributes in the list.

getName

public String getName(int i)
Returns the name of the attribute at the given index.

Parameters: i The position of the attribute in the list.

Returns: The attribute name as a string, or null if there is no attribute at that position.

getType

public String getType(int i)
Returns the type of the attribute at the specified index.

Parameters: i The position of the attribute in the list.

Returns: The attribute type as a string ("NMTOKEN" for an enumeration, and "CDATA" if no declaration was read), or null if there is no attribute at that position.
Note: Not supported, will simply return null.

getType

public String getType(String name)
Return the type of the attribute with the given name.

Parameters: name The attribute name.

Returns: The attribute type as a string ("NMTOKEN" for an enumeration, and "CDATA" if no declaration was read).
Note: Not supported, will simply return null.

getValue

public String getValue(int i)
Return the value of the attribute at the specified index

Parameters: i The position of the attribute in the list.

Returns: The attribute value as a string, or null if there is no attribute at that position.

getValue

public String getValue(String name)
Get the value of an attribute (by name).

Parameters: name The attribute name.

See Also: org.xml.sax.AttributeList#getValue(java.lang.String)

remove

public void remove(int index)
Removes the name-value pair at the given index

Parameters: index the index to remove the name value pair from

remove

public void remove(String name)
Removes the name and it's associated value from this AttributeList

Parameters: the name of the attribute mapping to remove