Class Cache<V>


  • public class Cache<V>
    extends java.lang.Object
    Links an arrow function to an LRU cache. The function converts a string to a value of type T. The string itself is used as the cache key. Examples: * Caching a number or date pattern. The cache key is the string representation of the pattern. * Caching any object that is expensive to create, where the cache key identifies the type of object to cache. Ported from @phensley/cldr-utils src/cache.ts Modified to use ConcurrentHashMap
    • Constructor Summary

      Constructors 
      Constructor Description
      Cache​(java.util.function.Function<java.lang.String,​V> builder, int initialCapacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V get​(java.lang.String raw)  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Cache

        public Cache​(java.util.function.Function<java.lang.String,​V> builder,
                     int initialCapacity)
    • Method Detail

      • size

        public int size()
      • get

        public V get​(java.lang.String raw)