Code example for ConcurrentMap

Methods: containsValue

0
    /** 
     * Checks if the given value is currently held in memory. For performance reasons, this method 
     * does NOT probe the disk cache. 
     */ 
    public synchronized boolean containsValue(Object value) {
        return cache.containsValue(value);
    } 
 
    /** 
     * Removes an entry from both memory and disk. 
     */ 
    @SuppressWarnings("unchecked") 
    public synchronized ValT remove(Object key) {
        ValT value = removeKey(key);
 
        if (isDiskCacheEnabled) {
            File cachedValue = getFileForKey((KeyT) key);
            if (cachedValue.exists()) {
                cachedValue.delete();
            } 
        }