Package org.apache.xml.utils
Class StringToStringTableVector
java.lang.Object
org.apache.xml.utils.StringToStringTableVector
A very simple table that stores a list of StringToStringTables, optimized
for small lists.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StringToStringTableVector
(int blocksize) Construct a StringToStringTableVector, using the given block size. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addElement
(StringToStringTable value) Append a StringToStringTable object onto the vector.final boolean
Tell if the table contains the given StringToStringTable.final boolean
containsKey
(String key) Given a string, find out if there is a value in this table that matches the key.final StringToStringTable
elementAt
(int i) Get the nth element.final String
Given a string, find the last added occurance value that matches the key.final int
Get the length of the list.final void
Remove the last element.final int
size()
Get the length of the list.
-
Constructor Details
-
StringToStringTableVector
public StringToStringTableVector()Default constructor. Note that the default block size is very small, for small lists. -
StringToStringTableVector
public StringToStringTableVector(int blocksize) Construct a StringToStringTableVector, using the given block size.- Parameters:
blocksize
- Size of blocks to allocate
-
-
Method Details
-
getLength
public final int getLength()Get the length of the list.- Returns:
- Number of StringToStringTable objects in the list
-
size
public final int size()Get the length of the list.- Returns:
- Number of StringToStringTable objects in the list
-
addElement
Append a StringToStringTable object onto the vector.- Parameters:
value
- StringToStringTable object to add
-
get
Given a string, find the last added occurance value that matches the key.- Parameters:
key
- String to look up- Returns:
- the last added occurance value that matches the key or null if not found.
-
containsKey
Given a string, find out if there is a value in this table that matches the key.- Parameters:
key
- String to look for- Returns:
- True if the string was found in table, null if not
-
removeLastElem
public final void removeLastElem()Remove the last element. -
elementAt
Get the nth element.- Parameters:
i
- Index of element to find- Returns:
- The StringToStringTable object at the given index
-
contains
Tell if the table contains the given StringToStringTable.- Parameters:
s
- The StringToStringTable to find- Returns:
- True if the StringToStringTable is found
-