private Object peekCache(String key, int userId) { synchronized (mCache) { // Safe to reuse mCacheKey, because it is not stored in the map. return mCache.get(mCacheKey.set(key, userId)); } }
private void invalidateCache(String key, int userId) { synchronized (mCache) { // Safe to reuse mCacheKey, because it is not stored in the map. mCache.remove(mCacheKey.set(key, userId)); } }
private CacheElement get(long address) { key.set(address); return get(key); }