Interface AbstractUserAgentAnalyzer.CacheInstantiator

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultCacheInstantiator, Java11CacheInstantiator, Java8CacheInstantiator
Enclosing class:
AbstractUserAgentAnalyzer

public static interface AbstractUserAgentAnalyzer.CacheInstantiator extends Serializable
  • Method Details

    • instantiateCache

      Map<String,UserAgent.ImmutableUserAgent> instantiateCache(int cacheSize)
      A single method that must create a new instance of the cache. The returned instance MUST implement at least the Map.get(java.lang.Object) and Map.put(K, V) methods in a threadsafe way if you intend to use this in a multithreaded scenario. Yauaa only uses the put and get methods and in exceptional cases the clear method. An implementation that does some kind of automatic cleaning of obsolete values is recommended (like LRU).
      Parameters:
      cacheSize - is the size of the new cache (which will be >= 1)
      Returns:
      Instance of the new cache.