@Override public V getValue(final K key) { ValueHolder<V> value = map.get(key); if (value == null) { value = function.apply(key); ValueHolder<V> previous = map.putIfAbsent(key, value); if (previous != null) { value = previous; } // finally, check that we are not over the bound if (maxSize != null && size() > maxSize) { clear(); } } return value.get(); }
@Override public V getValue(final K key) { ValueHolder<V> value = map.get(key); if (value == null) { value = function.apply(key); ValueHolder<V> previous = map.putIfAbsent(key, value); if (previous != null) { value = previous; } // finally, check that we are not over the bound if (maxSize != null && size() > maxSize) { clear(); } } return value.get(); }
@Override public V getValue(final K key) { ValueHolder<V> value = map.get(key); if (value == null) { value = function.apply(key); ValueHolder<V> previous = map.putIfAbsent(key, value); if (previous != null) { value = previous; } // finally, check that we are not over the bound if (maxSize != null && size() > maxSize) { clear(); } } return value.get(); }
@Override public V getValue(final K key) { ValueHolder<V> value = map.get(key); if (value == null) { value = function.apply(key); ValueHolder<V> previous = map.putIfAbsent(key, value); if (previous != null) { value = previous; } // finally, check that we are not over the bound if (maxSize != null && size() > maxSize) { clear(); } } return value.get(); }
@Override public V getValue(final K key) { ValueHolder<V> value = map.get(key); if (value == null) { value = function.apply(key); ValueHolder<V> previous = map.putIfAbsent(key, value); if (previous != null) { value = previous; } // finally, check that we are not over the bound if (maxSize != null && size() > maxSize) { clear(); } } return value.get(); }
@Override public V getValue(final K key) { ValueHolder<V> value = map.get(key); if (value == null) { value = function.apply(key); ValueHolder<V> previous = map.putIfAbsent(key, value); if (previous != null) { value = previous; } // finally, check that we are not over the bound if (maxSize != null && size() > maxSize) { clear(); } } return value.get(); }