public void put(String url, String result, long expiry) { if (!enabled || url == null || result == null) return; if (expiry < MIN_EXPIRY_TIME) { expiry = MIN_EXPIRY_TIME; } mMemoryCache.put(url, result, System.currentTimeMillis() + expiry); }
public void clear() { mMemoryCache.evictAll(); }
public String get(String url) { return enabled ? mMemoryCache.get(url) : null; }
public void setCacheSize(int strLength) { if (strLength > DEFAULT_CACHE_SIZE) { mMemoryCache.setMaxSize(strLength); } }