Java Blog» Creating a simple cache in Java using a LinkedHashMap and an Anonymous Inner Class 14 this.cache...

Please Visit: http://ift.tt/1ajReyV



Java Blog» Creating a simple cache in Java using a LinkedHashMap and an Anonymous Inner Class

14

this.cache = new LinkedHashMap<String, Integer>(CACHE_MAX_SIZE, 0.75f, true) { 15

protected boolean removeEldestEntry(16

Map.Entry<String, Integer> eldest) {17

// Remove the eldest entry if the size of the cache exceeds the18

// maximum size19

return size() > CACHE_MAX_SIZE;20

}21

};22

}

http://ift.tt/1mOl5sg

http://ift.tt/1k6vGQw



Java Blog» Creating a simple cache in Java using a LinkedHashMap and an Anonymous Inner Class







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1mOl5Zq

via LifeLong Community

No comments:

Post a Comment