List of usage examples for android.support.v4.util LruCache remove
public final V remove(K key)
From source file:org.schabi.newpipe.util.InfoCache.java
private static Info getInfo(@NonNull final LruCache<String, CacheData> cache, @NonNull final String key) { final CacheData data = cache.get(key); if (data == null) return null; if (data.isExpired()) { cache.remove(key); return null; }/*from w ww .j a va2 s . c o m*/ return data.info; }
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 w w. ja v a 2 s . c o m*/ } }