org.apache.xml.utils
Class StringToStringTable
java.lang.Object
org.apache.xml.utils.StringToStringTable
public class StringToStringTable
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.
|
boolean | containsValue(String val) - Tell if the table contains the given string.
|
String | elementAt(int i) - Get the nth element.
|
String | get(String key) - Tell if the table contains the given string.
|
String | getByValue(String val) - Tell if the table contains the given string in the value.
|
String | getIgnoreCase(String key) - Tell if the table contains the given string.
|
int | getLength() - Get the length of the list.
|
void | put(String key, String value) - Append a string onto the vector.
|
void | remove(String key) - Remove the given string and its value from this table.
|
StringToStringTable
public StringToStringTable()
Default constructor. Note that the default
block size is very small, for small lists.
StringToStringTable
public StringToStringTable(int blocksize)
Construct a StringToStringTable, using the given block size.
blocksize
- Size of blocks to allocate
contains
public final boolean contains(String key)
Tell if the table contains the given string.
- True if the given string is in this table
containsValue
public final boolean containsValue(String val)
Tell if the table contains the given string.
- True if the given value is in the table.
elementAt
public final String elementAt(int i)
Get the nth element.
i
- index of the string to look up.
- The string at the given index.
get
public final String get(String key)
Tell if the table contains the given string.
- return the value of the string or null if not found.
getByValue
public final String getByValue(String val)
Tell if the table contains the given string in the value.
val
- Value of the string to look up
- the string associated with the given value or null if not found
getIgnoreCase
public final String getIgnoreCase(String key)
Tell if the table contains the given string. Ignore case
- The value of the string or null if not found
getLength
public final int getLength()
Get the length of the list.
- Number of strings in the list
put
public final void put(String key,
String value)
Append a string onto the vector.
The strings go to the even locations in the array
and the values in the odd.
key
- String to add to the listvalue
- Value of the string
remove
public final void remove(String key)
Remove the given string and its value from this table.
key
- String to remove from the table
Copyright B) 2006 Apache XML Project. All Rights Reserved.