Package org.apache.xml.dtm.ref
Class DTMSafeStringPool
java.lang.Object
org.apache.xml.dtm.ref.DTMStringPool
org.apache.xml.dtm.ref.DTMSafeStringPool
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionindexToString(int i) static voidCommand-line unit test driver.voidint
-
Constructor Details
-
DTMSafeStringPool
public DTMSafeStringPool()
-
-
Method Details
-
removeAllElements
public void removeAllElements()- Overrides:
removeAllElementsin classDTMStringPool
-
indexToString
- Overrides:
indexToStringin classDTMStringPool- Returns:
- string whose value is uniquely identified by this integer index.
- Throws:
ArrayIndexOutOfBoundsException- if index doesn't map to a string.
-
stringToIndex
- Overrides:
stringToIndexin classDTMStringPool- Returns:
- integer index uniquely identifying the value of this string.
-
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.
-