MCPcopy Create free account
hub / github.com/apache/pig / put

Method put

src/org/apache/pig/impl/util/MultiMap.java:65–74  ·  view source on GitHub ↗

Add an element to the map. @param key The key to store the value under. If the key already exists the value will be added to the collection for that key, it will not replace the existing value (as in a standard map). @param value value to store.

(K key, V value)

Source from the content-addressed store, hash-verified

63 * @param value value to store.
64 */
65 public void put(K key, V value) {
66 ArrayList<V> list = mMap.get(key);
67 if (list == null) {
68 list = new ArrayList<V>();
69 list.add(value);
70 mMap.put(key, list);
71 } else {
72 list.add(value);
73 }
74 }
75
76 /**
77 * Add a key to the map with a collection of elements.

Calls 3

getMethod · 0.65
addMethod · 0.65
addAllMethod · 0.65