Name | HashMap |
||||||
---|---|---|---|---|---|---|---|
Examples | HashMap hm = new HashMap(); hm.put("Ava", 1); hm.put("Cait", 35); hm.put("Casey", 36); Iterator i = hm.entrySet().iterator(); // Get an iterator while (i.hasNext()) { Map.Entry me = (Map.Entry)i.next(); print(me.getKey() + " is "); println(me.getValue()); } |
||||||
Description | A HashMap stores a collection of objects, each referenced by a key. This is similar to an Array, only instead of accessing elements with a numeric index, a String is used. (If you are familiar with associative arrays from other languages, this is the same idea.) The above example covers basic use, but there's a more extensive example included with the Processing examples. For a list of the numerous HashMap features, please read the Java reference description. |
||||||
Constructor | HashMap() HashMap(initialCapacity) HashMap(initialCapacity, loadFactor) HashMap(m) |
||||||
Parameters |
|
||||||
Usage | Web & Application |