org.carrot2.util.resource
Class ResourceCache<V>

java.lang.Object
  extended by org.carrot2.util.resource.ResourceCache<V>
Type Parameters:
V - Resource value class.

public final class ResourceCache<V>
extends Object

A static cache of immutable, reusable resources associated with a given ResourceLookup. Roughly the same thing can be achieved with a MapMaker, but we want some logging in place too.


Constructor Summary
ResourceCache(com.google.common.base.Function<ResourceLookup,V> valueMaker)
          Create a resource cache with the provided value maker.
 
Method Summary
 V get(ResourceLookup resourceLookup, boolean recreate)
          Acquire a resource from the resource lookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCache

public ResourceCache(com.google.common.base.Function<ResourceLookup,V> valueMaker)
Create a resource cache with the provided value maker.

Method Detail

get

public V get(ResourceLookup resourceLookup,
             boolean recreate)
Acquire a resource from the resource lookup.



Copyright (c) Dawid Weiss, Stanislaw Osinski