开发者

I'm trying to simulate a directly mapped cache in java. Any ideas on which data structure to use to represent the cache?

开发者 https://www.devze.com 2022-12-28 23:27 出处:网络
I\'m trying to simulate a directly mapped cache in java.Any ideas on which data structure to开发者_C百科 use to represent the cache?Try a Map interface for the reference type and WeakHashMap as the im

I'm trying to simulate a directly mapped cache in java. Any ideas on which data structure to开发者_C百科 use to represent the cache?


Try a Map interface for the reference type and WeakHashMap as the implementation:

int initialCapacity = 1024;    
Map<K, V> cache = new WeakHashMap<K, V>(initialCapacity);
0

精彩评论

暂无评论...
验证码 换一张
取 消