[New] Added putAll and addAll to MapOf* collections
This commit is contained in:
parent
16f16c330b
commit
2bc76ca79b
|
@ -121,4 +121,11 @@ public class MapOfLists<T, U> {
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return this.mapOfLists.isEmpty();
|
return this.mapOfLists.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapOfLists<T, U> addAll(MapOfLists<T, U> other) {
|
||||||
|
for (T key : other.keySet()) {
|
||||||
|
addList(key, other.getList(key));
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,4 +169,11 @@ public class MapOfMaps<T, U, V> {
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return this.mapOfMaps.isEmpty();
|
return this.mapOfMaps.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapOfMaps<T, U, V> putAll(MapOfMaps<T, U, V> other) {
|
||||||
|
for (T key : other.keySet()) {
|
||||||
|
addMap(key, other.getMap(key));
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,4 +120,11 @@ public class MapOfSets<T, U> {
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return this.mapOfSets.isEmpty();
|
return this.mapOfSets.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapOfSets<T, U> addAll(MapOfSets<T, U> other) {
|
||||||
|
for (T key : other.keySet()) {
|
||||||
|
addSet(key, other.getSet(key));
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue