org.apache.xml.utils
Class StringToIntTable
java.lang.Object
|
+--org.apache.xml.utils.StringToIntTable
- public class StringToIntTable
- extends java.lang.Object
**For internal use only**
A very simple lookup table that stores a list of strings, the even
number strings being keys, and the odd number strings being values.
Method Summary |
boolean |
contains(java.lang.String key)
Tell if the table contains the given string. |
int |
get(java.lang.String key)
Tell if the table contains the given string. |
int |
getIgnoreCase(java.lang.String key)
Tell if the table contains the given string. |
int |
getLength()
Get the length of the list. |
java.lang.String[] |
keys()
Return array of keys in the table. |
void |
put(java.lang.String key,
int value)
Append a string onto the vector. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
INVALID_KEY
public static final int INVALID_KEY
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
getLength
public final int getLength()
- Get the length of the list.
- Returns:
- the length of the list
put
public final void put(java.lang.String key,
int value)
- Append a string onto the vector.
- Parameters:
key
- String to appendvalue
- The int value of the string
get
public final int get(java.lang.String key)
- Tell if the table contains the given string.
- Parameters:
key
- String to look for- Returns:
- The String's int value
getIgnoreCase
public final int getIgnoreCase(java.lang.String key)
- Tell if the table contains the given string. Ignore case.
- Parameters:
key
- String to look for- Returns:
- The string's int value
contains
public final boolean contains(java.lang.String key)
- Tell if the table contains the given string.
- Parameters:
key
- String to look for- Returns:
- True if the string is in the table
keys
public final java.lang.String[] keys()
- Return array of keys in the table.
- Returns:
- Array of strings
Copyright © 2003 Apache XML Project. All Rights Reserved.