APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.utils

public Class StringVector

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

A very simple table that stores a list of strings, optimized for small lists.

Field Summary

Modifier and TypeField and Description
protected int
protected int
protected String[]
protected int
pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
StringVector()

Default constructor.

public
StringVector(int
Size of the blocks to allocate
blocksize
)

Construct a StringVector, using the given block size.

Method Summary

Modifier and TypeMethod and Description
public final void
addElement(String
Sting to add to the vector
value
)

Append a string onto the vector.

public final boolean

Returns:

True if the string is in this table
contains
(String
String to look for
s
)

Tell if the table contains the given string.

public final boolean

Returns:

True if the String is in this vector
containsIgnoreCase
(String
String to find
s
)

Tell if the table contains the given string.

public final String

Returns:

String at given index
elementAt
(int
Index of string to find
i
)

Get the nth element.

public int

Returns:

Number of strings in the list
getLength
()

Get the length of the list.

public final String

Returns:

The string at the tail of this vector.
peek
()

Get the string at the tail of this vector without popping.

public final String

Returns:

The String last added to this vector or null not found. The string is removed from the vector.
pop
()

Pop the tail of this vector.

public final void
push(String
String to push into the vector
s
)

Tell if the table contains the given string.

public final int

Returns:

Number of strings in the list
size
()

Get the length of the list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_blocksizeback to summary
protected int m_blocksize
m_firstFreeback to summary
protected int m_firstFree
m_mapback to summary
protected String[] m_map
m_mapSizeback to summary
protected int m_mapSize
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Constructor Detail

StringVectorback to summary
public StringVector()

Default constructor. Note that the default block size is very small, for small lists.

StringVectorback to summary
public StringVector(int blocksize)

Construct a StringVector, using the given block size.

Parameters
blocksize:int

Size of the blocks to allocate

Method Detail

addElementback to summary
public final void addElement(String value)

Append a string onto the vector.

Parameters
value:String

Sting to add to the vector

containsback to summary
public final boolean contains(String s)

Tell if the table contains the given string.

Parameters
s:String

String to look for

Returns:boolean

True if the string is in this table

containsIgnoreCaseback to summary
public final boolean containsIgnoreCase(String s)

Tell if the table contains the given string. Ignore case.

Parameters
s:String

String to find

Returns:boolean

True if the String is in this vector

elementAtback to summary
public final String elementAt(int i)

Get the nth element.

Parameters
i:int

Index of string to find

Returns:String

String at given index

getLengthback to summary
public int getLength()

Get the length of the list.

Returns:int

Number of strings in the list

peekback to summary
public final String peek()

Get the string at the tail of this vector without popping.

Returns:String

The string at the tail of this vector.

popback to summary
public final String pop()

Pop the tail of this vector.

Returns:String

The String last added to this vector or null not found. The string is removed from the vector.

pushback to summary
public final void push(String s)

Tell if the table contains the given string.

Parameters
s:String

String to push into the vector

sizeback to summary
public final int size()

Get the length of the list.

Returns:int

Number of strings in the list