List of usage examples for android.support.v4.util LruCache snapshot
public synchronized final Map<K, V> snapshot()
From source file:org.schabi.newpipe.util.InfoCache.java
private static void removeStaleCache(@NonNull final LruCache<String, CacheData> cache) { for (Map.Entry<String, CacheData> entry : cache.snapshot().entrySet()) { final CacheData data = entry.getValue(); if (data != null && data.isExpired()) { cache.remove(entry.getKey()); }//from w ww. j a v a2 s . c o m } }