mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Added methods isEmpty(), putAll(), toArray() to interfaces List and Map
This commit is contained in:
@ -44,6 +44,10 @@ public class HashMap<K, V> implements Map<K, V> {
|
||||
return r;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
@ -179,6 +183,12 @@ public class HashMap<K, V> implements Map<K, V> {
|
||||
return (c == null ? null : c.getValue());
|
||||
}
|
||||
|
||||
public void putAll(Map<? extends K,? extends V> elts) {
|
||||
for (Map.Entry<? extends K, ? extends V> entry : elts.entrySet()) {
|
||||
put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public V remove(K key) {
|
||||
Cell<K, V> c = removeCell(key);
|
||||
return (c == null ? null : c.getValue());
|
||||
|
Reference in New Issue
Block a user