org.apache.xml.utils
Class StringVector
java.lang.Object
org.apache.xml.utils.StringVector
- java.io.Serializable
public class StringVector
extends java.lang.Object
implements java.io.Serializable
A very simple table that stores a list of strings, optimized
for small lists.
void | addElement(String value) - Append a string onto the vector.
|
boolean | contains(String s) - Tell if the table contains the given string.
|
boolean | containsIgnoreCase(String s) - Tell if the table contains the given string.
|
String | elementAt(int i) - Get the nth element.
|
int | getLength() - Get the length of the list.
|
String | peek() - Get the string at the tail of this vector without popping.
|
String | pop() - Pop the tail of this vector.
|
void | push(String s) - Tell if the table contains the given string.
|
int | size() - Get the length of the list.
|
StringVector
public StringVector()
Default constructor. Note that the default
block size is very small, for small lists.
StringVector
public StringVector(int blocksize)
Construct a StringVector, using the given block size.
blocksize
- Size of the blocks to allocate
addElement
public final void addElement(String value)
Append a string onto the vector.
value
- Sting to add to the vector
contains
public final boolean contains(String s)
Tell if the table contains the given string.
- True if the string is in this table
containsIgnoreCase
public final boolean containsIgnoreCase(String s)
Tell if the table contains the given string. Ignore case.
- True if the String is in this vector
elementAt
public final String elementAt(int i)
Get the nth element.
i
- Index of string to find
getLength
public int getLength()
Get the length of the list.
- Number of strings in the list
peek
public final String peek()
Get the string at the tail of this vector without popping.
- The string at the tail of this vector.
pop
public final String pop()
Pop the tail of this vector.
- The String last added to this vector or null not found.
The string is removed from the vector.
push
public final void push(String s)
Tell if the table contains the given string.
s
- String to push into the vector
size
public final int size()
Get the length of the list.
- Number of strings in the list
Copyright B) 2004 Apache XML Project. All Rights Reserved.