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

public Class CustomStringPool

extends DTMStringPool
Class Inheritance
Imports
java.util.HashMap, .Map

CustomStringPool is an example of an application-provided data structure for a DTM implementation to hold symbol references, e.g. element names. It will follow the DTMStringPool interface and use two simple methods indexToString(int i) and stringToIndex(String s) to map between a set of string values and a set of integer index values. Therefore, an application may improve DTM processing speed by substituting the DTM symbol resolution tables with application specific quick symbol resolution tables.

%REVIEW% The only difference between this an DTMStringPool seems to be that it uses a java.lang.Hashtable full of Integers rather than implementing its own hashing. Joe deliberately avoided that approach when writing DTMStringPool, since it is both much more memory-hungry and probably slower -- especially in JDK 1.1.x, where Hashtable is synchronized. We need to either justify this implementation or discard it.

Status: In progress, under discussion.

Field Summary

Modifier and TypeField and Description
pack-priv final Map<String, Integer>
public static final int
Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool:
m_intToString

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public 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 void
public 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.

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

Field Detail

m_stringToIntback to summary
pack-priv final Map<String, Integer> m_stringToInt

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

NULLback to summary
public static final int NULL

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

Constructor Detail

CustomStringPoolback to summary
public CustomStringPool()

Method Detail

indexToStringback to summary
public String indexToString(int i) throws IndexOutOfBoundsException

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

Returns:String

string whose value is uniquely identified by this integer index.

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if index doesn't map to a string.
removeAllElementsback to summary
public void removeAllElements()

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

stringToIndexback to summary
public 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.

Annotations
@Override