Methods Summary |
---|
public final boolean | contains(java.lang.String key)Tell if the table contains the given string.
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equals(key))
return true;
}
return false;
|
public final int | get(java.lang.String key)Tell if the table contains the given string.
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equals(key))
return m_values[i];
}
return INVALID_KEY;
|
public final int | getIgnoreCase(java.lang.String key)Tell if the table contains the given string. Ignore case.
if (null == key)
return INVALID_KEY;
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equalsIgnoreCase(key))
return m_values[i];
}
return INVALID_KEY;
|
public final int | getLength()Get the length of the list.
return m_firstFree;
|
public final java.lang.String[] | keys()Return array of keys in the table.
String [] keysArr = new String[m_firstFree];
for (int i = 0; i < m_firstFree; i++)
{
keysArr[i] = m_map[i];
}
return keysArr;
|
public final void | put(java.lang.String key, int value)Append a string onto the vector.
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
String newMap[] = new String[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
int newValues[] = new int[m_mapSize];
System.arraycopy(m_values, 0, newValues, 0, m_firstFree + 1);
m_values = newValues;
}
m_map[m_firstFree] = key;
m_values[m_firstFree] = value;
m_firstFree++;
|