org.apache.xml.dtm.ref

Class DTMSafeStringPool


public class DTMSafeStringPool
extends DTMStringPool

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

Fields inherited from class org.apache.xml.dtm.ref.DTMStringPool

NULL

Method Summary

String
indexToString(int i)
static void
main(String[] args)
Command-line unit test driver.
void
removeAllElements()
int
stringToIndex(String s)

Methods inherited from class org.apache.xml.dtm.ref.DTMStringPool

indexToString, main, removeAllElements, stringToIndex

Method Details

indexToString

public String indexToString(int i)
            throws java.lang.ArrayIndexOutOfBoundsException
Overrides:
indexToString in interface DTMStringPool

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


main

public static void main(String[] args)
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.
Overrides:
main in interface DTMStringPool


removeAllElements

public void removeAllElements()
Overrides:
removeAllElements in interface DTMStringPool


stringToIndex

public int stringToIndex(String s)
Overrides:
stringToIndex in interface DTMStringPool

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


Copyright B) 2004 Apache XML Project. All Rights Reserved.