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().
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | _main(String[] args)
Hides com. Command-line unit test driver. |
| public synchronized String | indexToString(int i)
Overrides com. Returns: string whose value is uniquely identified by this integer index. |
| public synchronized void | |
| public synchronized int | stringToIndex(String s)
Overrides com. Returns: integer index uniquely identifying the value of this string. |
| DTMSafeStringPool | back to summary |
|---|---|
| public DTMSafeStringPool() | |
| _main | back to summary |
|---|---|
| public static void _main(String[] args) Hides com. 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. | |
| indexToString | back to summary |
|---|---|
| public synchronized String indexToString(int i) throws ArrayIndexOutOfBoundsException Overrides com.
| |
| removeAllElements | back to summary |
|---|---|
| public synchronized void removeAllElements() Overrides com. | |
| stringToIndex | back to summary |
|---|---|
| public synchronized int stringToIndex(String s) Overrides com.
| |