org.apache.xml.utils
Class StringToIntTable
java.lang.Object
org.apache.xml.utils.StringToIntTable
public class StringToIntTable
extends java.lang.Object
A very simple lookup table that stores a list of strings, the even
number strings being keys, and the odd number strings being values.
boolean | contains(String key) - Tell if the table contains the given string.
|
int | get(String key) - Tell if the table contains the given string.
|
int | getIgnoreCase(String key) - Tell if the table contains the given string.
|
int | getLength() - Get the length of the list.
|
String[] | keys() - Return array of keys in the table.
|
void | put(String key, int value) - Append a string onto the vector.
|
INVALID_KEY
public static final int INVALID_KEY
- -10000
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.
blocksize
- Size of block to allocate
contains
public final boolean contains(String key)
Tell if the table contains the given string.
key
- String to look for
- True if the string is in the table
get
public final int get(String key)
Tell if the table contains the given string.
key
- String to look for
- The String's int value
getIgnoreCase
public final int getIgnoreCase(String key)
Tell if the table contains the given string. Ignore case.
key
- String to look for
- The string's int value
getLength
public final int getLength()
Get the length of the list.
- the length of the list
keys
public final String[] keys()
Return array of keys in the table.
- Array of strings
put
public final void put(String key,
int value)
Append a string onto the vector.
key
- String to appendvalue
- The int value of the string
Copyright B) 2004 Apache XML Project. All Rights Reserved.