Code example for Cache

Methods: size

0
        return stats().evictionCount();
    } 
 
    @Override 
    public long getElementCount() { 
        return cache.size(); 
    } 
 
    @Override 
    public long estimateCurrentWeight() { 
        if (weigher == null) { 
            return -1; 
        } 
        long size = 0;
        for (Map.Entry<?, ?> e : cache.asMap().entrySet()) {
            Object k = e.getKey();
            Object v = e.getValue();
            size += weigher.weigh(k, v);
        } 
        return size;
Connect your IDE to all the code out there  Get Codota for Java