开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜