Skip to content

Instantly share code, notes, and snippets.

@cobolfoo
Created October 4, 2014 02:47
Show Gist options
  • Save cobolfoo/b38d80c6c105b8aa36be to your computer and use it in GitHub Desktop.
Save cobolfoo/b38d80c6c105b8aa36be to your computer and use it in GitHub Desktop.
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