|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object | +--Hashtable
This class implements a hashtable, which maps keys to values.
| Constructor Summary | |
Hashtable
()
|
|
| Method Summary | |
function
|
clear()
Clears the hashtable so that it contains no keys. |
function
|
containsKey(key)
Tests if the specified string is a key in the hashtable. |
function
|
containsValue(value)
Tests if the specified object is a value in the hashtable. |
function
|
get(key)
Returns the value for the specifies key. |
function
|
isEmpty()
Tests if the hashtable maps no keys to values. |
function
|
keys()
Returns an array of the keys in the hashtable. |
function
|
put(key, value)
Maps the specified key to the specified value in the hashtable. |
function
|
remove(key)
Removes the key (and its corresponding value) from the hashtable. |
function
|
size()
Returns the size of the hastable. |
function
|
toArray()
Returns an array of the values in the hashtable. |
function
|
values()
Returns the hashtable. |
| Constructor Detail |
function Hashtable()
| Method Detail |
function clear()
function containsKey(key)
key - Possible key.
function containsValue(value)
value - Possible value.
function get(key)
key - Possible key.
function isEmpty()
function keys()
function put(key, value)
value - The value to associate with the specified key.
key - The hashtable key.
function remove(key)
key - The key to remove.
function size()
function toArray()
function values()
var table = new Hashtable();
var s = "";
table.put ("key1", "Mary ");
table.put ("key2", "had ");
table.put ("key3", "etc...");
for (var i in table.values())
{
s+=table.values()[i];
}
Running the routine will result in the string s containing "Mary had etc..."
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||