Interface Cache<K,​V>

  • All Superinterfaces:
    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>>
    All Known Implementing Classes:
    BasicCache, ProvidedCache

    public interface Cache<K,​V>
    extends java.lang.Iterable<java.util.Map.Entry<K,​V>>, org.comroid.mutatio.ref.ReferenceMap.Settable<K,​V,​Cache.Reference<K,​V>>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Cache.Reference<K,​V>  
      • 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>>
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean canProvide()  
      boolean containsKey​(K key)  
      boolean containsValue​(V value)  
      default void forEach​(java.util.function.BiConsumer<K,​V> action)  
      @NotNull Cache.Reference<K,​V> getReference​(K key, boolean createIfAbsent)  
      boolean large()  
      default org.comroid.mutatio.pipe.Pipe<?,​Cache.Reference<K,​V>> pipe()  
      org.comroid.mutatio.pipe.Pipe<?,​Cache.Reference<K,​V>> pipe​(java.util.function.Predicate<K> filter)  
      default java.util.concurrent.CompletableFuture<V> provide​(K key)  
      int size()  
      default java.util.stream.Stream<Cache.Reference<K,​V>> stream()  
      java.util.stream.Stream<Cache.Reference<K,​V>> stream​(java.util.function.Predicate<K> filter)  
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, 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
    • Method Detail

      • large

        boolean large()
      • size

        int size()
      • containsKey

        boolean containsKey​(K key)
      • containsValue

        boolean containsValue​(V value)
      • stream

        java.util.stream.Stream<Cache.Reference<K,​V>> stream​(java.util.function.Predicate<K> filter)
      • pipe

        org.comroid.mutatio.pipe.Pipe<?,​Cache.Reference<K,​V>> pipe​(java.util.function.Predicate<K> filter)
      • getReference

        @NotNull
        @NotNull Cache.Reference<K,​V> getReference​(K key,
                                                         boolean createIfAbsent)
        Specified by:
        getReference in interface org.comroid.mutatio.ref.ReferenceMap<K,​V,​Cache.Reference<K,​V>>
      • canProvide

        default boolean canProvide()
      • provide

        default java.util.concurrent.CompletableFuture<V> provide​(K key)
      • forEach

        default void forEach​(java.util.function.BiConsumer<K,​V> action)