org.apache.xmlbeans
Class QNameCache

java.lang.Object
  extended by org.apache.xmlbeans.QNameCache

public final class QNameCache
extends java.lang.Object

A cache that can be used to pool QName instances. Each thread has one.


Constructor Summary
QNameCache(int initialCapacity)
          Creates a QNameCache with the given initialCapacity.
QNameCache(int initialCapacity, float loadFactor)
          Creates a QNameCache with the given initialCapacity and loadFactor.
 
Method Summary
 javax.xml.namespace.QName getName(java.lang.String uri, java.lang.String localName)
           
 javax.xml.namespace.QName getName(java.lang.String uri, java.lang.String localName, java.lang.String prefix)
          Fetches a QName with the given namespace and localname.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QNameCache

public QNameCache(int initialCapacity,
                  float loadFactor)
Creates a QNameCache with the given initialCapacity and loadFactor.

Parameters:
initialCapacity - the number of entries to initially make space for
loadFactor - a number to control the density of the hashtable

QNameCache

public QNameCache(int initialCapacity)
Creates a QNameCache with the given initialCapacity.

Parameters:
initialCapacity - the number of entries to initially make space for
Method Detail

getName

public javax.xml.namespace.QName getName(java.lang.String uri,
                                         java.lang.String localName)

getName

public javax.xml.namespace.QName getName(java.lang.String uri,
                                         java.lang.String localName,
                                         java.lang.String prefix)
Fetches a QName with the given namespace and localname. Creates one if one is not found in the cache.

Parameters:
uri - the namespace
localName - the localname
prefix - the prefix
Returns:
the cached QName