Class Cached<K,​V>

java.lang.Object
net.finmath.util.Cached<K,​V>
Type Parameters:
K - The type of the cache key.
V - The type of the value.
All Implemented Interfaces:
Function<K,​V>

public class Cached<K,​V> extends Object implements Function<K,​V>
A simple wrapper, wrapping a Function<K,V> such that all calculations are cached in a ConcurrentHashMap<K,V>
Author:
Christian Fries
  • Method Details

    • of

      public static <K,​ V> Function<K,​V> of(Function<K,​V> mappingFunction)
    • apply

      public V apply(K key)
      Specified by:
      apply in interface Function<K,​V>