示例#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);
   }
 }