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

public Class StringToStringTableVector

extends Object
Class Inheritance

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

Field Summary

Modifier and TypeField and Description
private int
m_blocksize

Size of blocks to allocate

private int
m_firstFree

Number of StringToStringTable objects in this array

private StringToStringTable[]
m_map

Array of StringToStringTable objects

private int
m_mapSize

Size of this array

Constructor Summary

AccessConstructor and Description
public
StringToStringTableVector()

Default constructor.

public
StringToStringTableVector(int
Size of blocks to allocate
blocksize
)

Construct a StringToStringTableVector, using the given block size.

Method Summary

Modifier and TypeMethod and Description
public final void
addElement(StringToStringTable
StringToStringTable object to add
value
)

Append a StringToStringTable object onto the vector.

public final boolean

Returns:

True if the StringToStringTable is found
contains
(StringToStringTable
The StringToStringTable to find
s
)

Tell if the table contains the given StringToStringTable.

public final boolean

Returns:

True if the string was found in table, null if not
containsKey
(String
String to look for
key
)

Given a string, find out if there is a value in this table that matches the key.

public final StringToStringTable

Returns:

The StringToStringTable object at the given index
elementAt
(int
Index of element to find
i
)

Get the nth element.

public final String

Returns:

the last added occurance value that matches the key or null if not found.
get
(String
String to look up
key
)

Given a string, find the last added occurance value that matches the key.

public final int

Returns:

Number of StringToStringTable objects in the list
getLength
()

Get the length of the list.

public final void
removeLastElem()

Remove the last element.

public final int

Returns:

Number of StringToStringTable objects in the list
size
()

Get the length of the list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_blocksizeback to summary
private int m_blocksize

Size of blocks to allocate

m_firstFreeback to summary
private int m_firstFree

Number of StringToStringTable objects in this array

m_mapback to summary
private StringToStringTable[] m_map

Array of StringToStringTable objects

m_mapSizeback to summary
private int m_mapSize

Size of this array

Constructor Detail

StringToStringTableVectorback to summary
public StringToStringTableVector()

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

StringToStringTableVectorback to summary
public StringToStringTableVector(int blocksize)

Construct a StringToStringTableVector, using the given block size.

Parameters
blocksize:int

Size of blocks to allocate

Method Detail

addElementback to summary
public final void addElement(StringToStringTable value)

Append a StringToStringTable object onto the vector.

Parameters
value:StringToStringTable

StringToStringTable object to add

containsback to summary
public final boolean contains(StringToStringTable s)

Tell if the table contains the given StringToStringTable.

Parameters
s:StringToStringTable

The StringToStringTable to find

Returns:boolean

True if the StringToStringTable is found

containsKeyback to summary
public final boolean containsKey(String key)

Given a string, find out if there is a value in this table that matches the key.

Parameters
key:String

String to look for

Returns:boolean

True if the string was found in table, null if not

elementAtback to summary
public final StringToStringTable elementAt(int i)

Get the nth element.

Parameters
i:int

Index of element to find

Returns:StringToStringTable

The StringToStringTable object at the given index

getback to summary
public final String get(String key)

Given a string, find the last added occurance value that matches the key.

Parameters
key:String

String to look up

Returns:String

the last added occurance value that matches the key or null if not found.

getLengthback to summary
public final int getLength()

Get the length of the list.

Returns:int

Number of StringToStringTable objects in the list

removeLastElemback to summary
public final void removeLastElem()

Remove the last element.

sizeback to summary
public final int size()

Get the length of the list.

Returns:int

Number of StringToStringTable objects in the list