org.apache.xalan.xsltc.runtime
Class AttributeList

java.lang.Object
  extended by org.apache.xalan.xsltc.runtime.AttributeList
All Implemented Interfaces:
org.xml.sax.Attributes

public class AttributeList
extends java.lang.Object
implements org.xml.sax.Attributes


Field Summary
private  Hashtable _attributes
           
private  int _length
           
private  java.util.Vector _names
           
private  java.util.Vector _qnames
           
private  java.util.Vector _uris
           
private  java.util.Vector _values
           
private static java.lang.String CDATASTRING
           
private static java.lang.String EMPTYSTRING
           
 
Constructor Summary
AttributeList()
          AttributeList constructor
AttributeList(org.xml.sax.Attributes attributes)
          Attributes clone constructor
 
Method Summary
 void add(java.lang.String qname, java.lang.String value)
          Adds an attribute to the list
private  void alloc()
          Allocate memory for the AttributeList %OPT% Use on-demand allocation for the internal vectors.
 void clear()
          Clears the attribute list
 int getIndex(java.lang.String qname)
          SAX2: Look up the index of an attribute by XML 1.0 qualified name.
 int getIndex(java.lang.String namespaceURI, java.lang.String localPart)
          SAX2: Look up the index of an attribute by Namespace name.
 int getLength()
          SAX2: Return the number of attributes in the list.
 java.lang.String getLocalName(int index)
          SAX2: Look up an attribute's local name by index.
 java.lang.String getQName(int pos)
          Return the name of an attribute in this list (by position).
 java.lang.String getType(int index)
          SAX2: Look up an attribute's type by index.
 java.lang.String getType(java.lang.String qname)
          SAX2: Look up an attribute's type by qname.
 java.lang.String getType(java.lang.String uri, java.lang.String localName)
          SAX2: Look up an attribute's type by Namespace name.
 java.lang.String getURI(int index)
          SAX2: Look up an attribute's Namespace URI by index.
 java.lang.String getValue(int pos)
          SAX2: Look up an attribute's value by index.
 java.lang.String getValue(java.lang.String qname)
          SAX2: Look up an attribute's value by qname.
 java.lang.String getValue(java.lang.String uri, java.lang.String localName)
          SAX2: Look up an attribute's value by Namespace name - SLOW!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTYSTRING

private static final java.lang.String EMPTYSTRING
See Also:
Constant Field Values

CDATASTRING

private static final java.lang.String CDATASTRING
See Also:
Constant Field Values

_attributes

private Hashtable _attributes

_names

private java.util.Vector _names

_qnames

private java.util.Vector _qnames

_values

private java.util.Vector _values

_uris

private java.util.Vector _uris

_length

private int _length
Constructor Detail

AttributeList

public AttributeList()
AttributeList constructor


AttributeList

public AttributeList(org.xml.sax.Attributes attributes)
Attributes clone constructor

Method Detail

alloc

private void alloc()
Allocate memory for the AttributeList %OPT% Use on-demand allocation for the internal vectors. The memory is only allocated when there is an attribute. This reduces the cost of creating many small RTFs.


getLength

public int getLength()
SAX2: Return the number of attributes in the list.

Specified by:
getLength in interface org.xml.sax.Attributes

getURI

public java.lang.String getURI(int index)
SAX2: Look up an attribute's Namespace URI by index.

Specified by:
getURI in interface org.xml.sax.Attributes

getLocalName

public java.lang.String getLocalName(int index)
SAX2: Look up an attribute's local name by index.

Specified by:
getLocalName in interface org.xml.sax.Attributes

getQName

public java.lang.String getQName(int pos)
Return the name of an attribute in this list (by position).

Specified by:
getQName in interface org.xml.sax.Attributes

getType

public java.lang.String getType(int index)
SAX2: Look up an attribute's type by index.

Specified by:
getType in interface org.xml.sax.Attributes

getIndex

public int getIndex(java.lang.String namespaceURI,
                    java.lang.String localPart)
SAX2: Look up the index of an attribute by Namespace name.

Specified by:
getIndex in interface org.xml.sax.Attributes

getIndex

public int getIndex(java.lang.String qname)
SAX2: Look up the index of an attribute by XML 1.0 qualified name.

Specified by:
getIndex in interface org.xml.sax.Attributes

getType

public java.lang.String getType(java.lang.String uri,
                                java.lang.String localName)
SAX2: Look up an attribute's type by Namespace name.

Specified by:
getType in interface org.xml.sax.Attributes

getType

public java.lang.String getType(java.lang.String qname)
SAX2: Look up an attribute's type by qname.

Specified by:
getType in interface org.xml.sax.Attributes

getValue

public java.lang.String getValue(int pos)
SAX2: Look up an attribute's value by index.

Specified by:
getValue in interface org.xml.sax.Attributes

getValue

public java.lang.String getValue(java.lang.String qname)
SAX2: Look up an attribute's value by qname.

Specified by:
getValue in interface org.xml.sax.Attributes

getValue

public java.lang.String getValue(java.lang.String uri,
                                 java.lang.String localName)
SAX2: Look up an attribute's value by Namespace name - SLOW!

Specified by:
getValue in interface org.xml.sax.Attributes

add

public void add(java.lang.String qname,
                java.lang.String value)
Adds an attribute to the list


clear

public void clear()
Clears the attribute list