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