Package org.apache.xml.serializer.utils
Class StringToIntTable
java.lang.Object
org.apache.xml.serializer.utils.StringToIntTable
A very simple lookup table that stores a list of strings, the even
number strings being keys, and the odd number strings being values.
This class is a copy of the one in org.apache.xml.utils.
It exists to cut the serializers dependancy on that package.
This class is not a public API, it is only public so it can be used
in org.apache.xml.serializer.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StringToIntTable
(int blocksize) Construct a StringToIntTable, using the given block size. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Tell if the table contains the given string.final int
Tell if the table contains the given string.final int
getIgnoreCase
(String key) Tell if the table contains the given string.final int
Get the length of the list.final String[]
keys()
Return array of keys in the table.final void
Append a string onto the vector.
-
Field Details
-
INVALID_KEY
public static final int INVALID_KEY- See Also:
-
-
Constructor Details
-
StringToIntTable
public StringToIntTable()Default constructor. Note that the default block size is very small, for small lists. -
StringToIntTable
public StringToIntTable(int blocksize) Construct a StringToIntTable, using the given block size.- Parameters:
blocksize
- Size of block to allocate
-
-
Method Details
-
getLength
public final int getLength()Get the length of the list.- Returns:
- the length of the list
-
put
Append a string onto the vector.- Parameters:
key
- String to appendvalue
- The int value of the string
-
get
Tell if the table contains the given string.- Parameters:
key
- String to look for- Returns:
- The String's int value
-
getIgnoreCase
Tell if the table contains the given string. Ignore case.- Parameters:
key
- String to look for- Returns:
- The string's int value
-
contains
Tell if the table contains the given string.- Parameters:
key
- String to look for- Returns:
- True if the string is in the table
-
keys
Return array of keys in the table.- Returns:
- Array of strings
-