org.apache.xml.utils

Class StringToIntTable

public class StringToIntTable extends 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.

UNKNOWN: internal

Field Summary
static intINVALID_KEY
Constructor Summary
StringToIntTable()
Default constructor.
StringToIntTable(int blocksize)
Construct a StringToIntTable, using the given block size.
Method Summary
booleancontains(String key)
Tell if the table contains the given string.
intget(String key)
Tell if the table contains the given string.
intgetIgnoreCase(String key)
Tell if the table contains the given string.
intgetLength()
Get the length of the list.
String[]keys()
Return array of keys in the table.
voidput(String key, int value)
Append a string onto the vector.

Field Detail

INVALID_KEY

public static final int INVALID_KEY

Constructor Detail

StringToIntTable

public StringToIntTable()
Default constructor. Note that the default block size is very small, for small lists.

StringToIntTable

public StringToIntTable(int blocksize)
Construct a StringToIntTable, using the given block size.

Parameters: blocksize Size of block to allocate

Method Detail

contains

public final boolean contains(String key)
Tell if the table contains the given string.

Parameters: key String to look for

Returns: True if the string is in the table

get

public final int get(String key)
Tell if the table contains the given string.

Parameters: key String to look for

Returns: The String's int value

getIgnoreCase

public final int getIgnoreCase(String key)
Tell if the table contains the given string. Ignore case.

Parameters: key String to look for

Returns: The string's int value

getLength

public final int getLength()
Get the length of the list.

Returns: the length of the list

keys

public final String[] keys()
Return array of keys in the table.

Returns: Array of strings

put

public final void put(String key, int value)
Append a string onto the vector.

Parameters: key String to append value The int value of the string

Copyright © 2005 Apache XML Project. All Rights Reserved.