mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-12 22:15:02 +00:00
feat[storage]: support primitive int-object and long-object storage
This commit is contained in:
1 parent
951e0ce133
commit
ad845b77a3
2 files changed
+7
-3
No files matched your search
@@ -27,13 +27,15 @@ public class StorageInt<K, V> extends Storage<K, V> {
|
||||
private IntObjectHashMap<V> dataMap = new IntObjectHashMap<V>();
|
||||
|
||||
public StorageInt(Storage<K, V> storage) {
|
||||
this.dataMap = new IntObjectHashMap<V>(storage.size());
|
||||
this.dataMap.putAll((Map<? extends Integer, ? extends V>) storage.getData());
|
||||
super.indexMap = storage.indexMap;
|
||||
super.uniqueIndexMap = storage.uniqueIndexMap;
|
||||
super.clazz = storage.clazz;
|
||||
super.idDef = storage.idDef;
|
||||
super.indexDefMap = storage.indexDefMap;
|
||||
super.recycle = storage.recycle;
|
||||
this.dataMap.putAll((Map<? extends Integer, ? extends V>) storage.getData());
|
||||
storage.recycleStorage();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,16 +26,18 @@ import java.util.Map;
|
||||
*/
|
||||
public class StorageLong<K, V> extends Storage<K, V> {
|
||||
|
||||
private LongObjectHashMap<V> dataMap = new LongObjectHashMap<V>();
|
||||
private LongObjectHashMap<V> dataMap;
|
||||
|
||||
public StorageLong(Storage<K, V> storage) {
|
||||
this.dataMap = new LongObjectHashMap<V>(storage.size());
|
||||
this.dataMap.putAll((Map<? extends Long, ? extends V>) storage.getData());
|
||||
super.indexMap = storage.indexMap;
|
||||
super.uniqueIndexMap = storage.uniqueIndexMap;
|
||||
super.clazz = storage.clazz;
|
||||
super.idDef = storage.idDef;
|
||||
super.indexDefMap = storage.indexDefMap;
|
||||
super.recycle = storage.recycle;
|
||||
this.dataMap.putAll((Map<? extends Long, ? extends V>) storage.getData());
|
||||
storage.recycleStorage();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user