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 += 2)
{
if (m_map[i].equals(key))
return true;
}
return false;
|
public final boolean | containsValue(java.lang.String val)Tell if the table contains the given string.
for (int i = 1; i < m_firstFree; i += 2)
{
if (m_map[i].equals(val))
return true;
}
return false;
|
public final java.lang.String | elementAt(int i)Get the nth element.
return m_map[i];
|
public final java.lang.String | get(java.lang.String key)Tell if the table contains the given string.
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equals(key))
return m_map[i + 1];
}
return null;
|
public final java.lang.String | getByValue(java.lang.String val)Tell if the table contains the given string in the value.
for (int i = 1; i < m_firstFree; i += 2)
{
if (m_map[i].equals(val))
return m_map[i - 1];
}
return null;
|
public final java.lang.String | getIgnoreCase(java.lang.String key)Tell if the table contains the given string. Ignore case
if (null == key)
return null;
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equalsIgnoreCase(key))
return m_map[i + 1];
}
return null;
|
public final int | getLength()Get the length of the list.
return m_firstFree;
|
public final void | put(java.lang.String key, java.lang.String value)Append a string onto the vector.
The strings go to the even locations in the array
and the values in the odd.
if ((m_firstFree + 2) >= 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;
}
m_map[m_firstFree] = key;
m_firstFree++;
m_map[m_firstFree] = value;
m_firstFree++;
|
public final void | remove(java.lang.String key)Remove the given string and its value from this table.
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equals(key))
{
if ((i + 2) < m_firstFree)
System.arraycopy(m_map, i + 2, m_map, i, m_firstFree - (i + 2));
m_firstFree -= 2;
m_map[m_firstFree] = null;
m_map[m_firstFree + 1] = null;
break;
}
}
|