Пример #1
0
  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);
  }
Пример #2
0
 public void clear() {
   mMemoryCache.evictAll();
 }
Пример #3
0
 public String get(String url) {
   return enabled ? mMemoryCache.get(url) : null;
 }
Пример #4
0
 public void setCacheSize(int strLength) {
   if (strLength > DEFAULT_CACHE_SIZE) {
     mMemoryCache.setMaxSize(strLength);
   }
 }