APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.dtm.ref

public Class DTMSafeStringPool

extends DTMStringPool
Class Inheritance

Like DTMStringPool, but threadsafe. It's been proposed that DTMs share their string pool(s); that raises threadsafety issues which this addresses. Of course performance is inferior to that of the bare-bones version.

Status: Passed basic test in main().

Field Summary

Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool:
m_intToStringm_stringToIntNULL

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
_main(String[] args)

Hides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool._main.

Command-line unit test driver.

public synchronized String
indexToString(int i)

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool.indexToString.

Returns: string whose value is uniquely identified by this integer index.

public synchronized void
public synchronized int
stringToIndex(String s)

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool.stringToIndex.

Returns: integer index uniquely identifying the value of this string.

Constructor Detail

DTMSafeStringPoolback to summary
public DTMSafeStringPool()

Method Detail

_mainback to summary
public static void _main(String[] args)

Hides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool._main.

Command-line unit test driver. This test relies on the fact that this version of the pool assigns indices consecutively, starting from zero, as new unique strings are encountered.

indexToStringback to summary
public synchronized String indexToString(int i) throws ArrayIndexOutOfBoundsException

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool.indexToString.

Returns:String

string whose value is uniquely identified by this integer index.

Exceptions
ArrayIndexOutOfBoundsException:
if index doesn't map to a string.
removeAllElementsback to summary
public synchronized void removeAllElements()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool.removeAllElements.

stringToIndexback to summary
public synchronized int stringToIndex(String s)

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool.stringToIndex.

Returns:int

integer index uniquely identifying the value of this string.