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