Finishing the ConcurrentMap implementation

This though isn't finishing the rest because the interface still needs
to be implemented.
-Added: Rest of the ConcurrentMap implementation
-Fixed: LinkedOpenHashMap Count method was returning prematurely.
This commit is contained in:
Speiger 2022-04-11 03:20:28 +02:00
parent 4f98c599df
commit 0350a77dff
2 changed files with 1058 additions and 12 deletions

View File

@ -905,9 +905,7 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
#endif
@Override
public boolean add(KEY_TYPE o) {
throw new UnsupportedOperationException();
}
public boolean add(KEY_TYPE o) { throw new UnsupportedOperationException(); }
@Override
public boolean addAndMoveToFirst(KEY_TYPE o) { throw new UnsupportedOperationException(); }
@ -1089,7 +1087,7 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
int result = 0;
int index = firstIndex;
while(index != -1){
if(filter.TEST_VALUE(keys[index])) return result++;
if(filter.TEST_VALUE(keys[index])) result++;
index = (int)links[index];
}
return result;
@ -1371,7 +1369,6 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
@Override
public void add(VALUE_TYPE e) { throw new UnsupportedOperationException(); }
}
private class MapIterator {