Class ProvidedCache<K,​V>

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<K,​V>>, org.comroid.mutatio.ref.ReferenceMap<K,​V,​Cache.Reference<K,​V>>, org.comroid.mutatio.ref.ReferenceMap.Settable<K,​V,​Cache.Reference<K,​V>>, Cache<K,​V>

    public class ProvidedCache<K,​V>
    extends BasicCache<K,​V>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.comroid.mutatio.ref.ReferenceMap

        org.comroid.mutatio.ref.ReferenceMap.Settable<K extends java.lang.Object,​V extends java.lang.Object,​REF extends org.comroid.mutatio.ref.Reference.Settable<V>>
    • Constructor Summary

      Constructors 
      Constructor Description
      ProvidedCache​(int largeThreshold, java.util.concurrent.Executor providerWriteExecutor, java.util.function.Function<K,​java.util.concurrent.CompletableFuture<V>> valueProvider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canProvide()  
      java.util.concurrent.CompletableFuture<V> provide​(K key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface org.comroid.mutatio.ref.ReferenceMap

        get, getReference, requireNonNull, requireNonNull, wrap
      • Methods inherited from interface org.comroid.mutatio.ref.ReferenceMap.Settable

        compute, computeIfAbsent, computeIfPresent, set
    • Field Detail

      • DEFAULT_EXECUTOR

        public static final java.util.concurrent.Executor DEFAULT_EXECUTOR
    • Constructor Detail

      • ProvidedCache

        public ProvidedCache​(int largeThreshold,
                             java.util.concurrent.Executor providerWriteExecutor,
                             java.util.function.Function<K,​java.util.concurrent.CompletableFuture<V>> valueProvider)
    • Method Detail

      • canProvide

        public boolean canProvide()
      • provide

        public java.util.concurrent.CompletableFuture<V> provide​(K key)