Maps are now copyable too

This commit is contained in:
2021-10-06 18:32:10 +02:00
parent dff173222d
commit 61d7a88c82
16 changed files with 223 additions and 4 deletions
@@ -554,6 +554,14 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
size = 0;
}
public ARRAY_MAP KEY_VALUE_GENERIC_TYPE copy() {
ARRAY_MAP KEY_VALUE_GENERIC_TYPE map = new ARRAY_MAPKV_BRACES();
map.size = size;
map.keys = Arrays.copyOf(keys, keys.length);
map.values = Arrays.copyOf(values, keys.length);
return map;
}
@Override
public COMPARATOR KEY_GENERIC_TYPE comparator() {
return null;
@@ -981,6 +989,11 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
return entrySet;
}
@Override
public SubMap copy() {
throw new UnsupportedOperationException();
}
@Override
public COMPARATOR KEY_GENERIC_TYPE comparator() {
return null;