mirror of
https://github.com/corda/corda.git
synced 2025-01-23 12:58:35 +00:00
Add method to create one hashtable from a map, useful in converting a
HashMap into a Hashtable.
This commit is contained in:
parent
3bafbf08bb
commit
8b2577b77c
@ -11,6 +11,13 @@ public class Hashtable<K, V> implements Map<K, V> {
|
|||||||
this(0);
|
this(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Hashtable(Map<? extends K,? extends V> m) {
|
||||||
|
this(m.size());
|
||||||
|
for (Entry<? extends K, ? extends V> entry : m.entrySet()) {
|
||||||
|
put(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return map.toString();
|
return map.toString();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user