Back to project page android-open-street-map.
The source code is released under:
Apache License
If you think the Android project android-open-street-map listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android.lib.map.osm; // ww w . j a v a2 s .c om import java.util.LinkedHashMap; import java.util.Map; public class LRUMap<K, V> extends LinkedHashMap<K, V> { private static final long serialVersionUID = 1L; private int maxCapacity; public LRUMap(int initialCapacity, int maxCapacity) { super(initialCapacity, 0.75f, true); this.maxCapacity = maxCapacity; } @Override protected boolean removeEldestEntry(Map.Entry<K, V> eldest) { return size() > this.maxCapacity; } }