Created
October 4, 2014 02:47
-
-
Save cobolfoo/b38d80c6c105b8aa36be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DuplicateHashMap<K,V> extends HashMap<K, Array<V>> { | |
public void put(K key, V value) { | |
Array<V> current = get(key); | |
if (current == null) { | |
current = new Array<V>(); | |
super.put(key, current); | |
} | |
current.add(value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment