Class FileCache<K,​V extends DataContainer<D>,​D>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Iterable<java.util.Map.Entry<K,​V>>, org.comroid.api.Disposable, org.comroid.api.Disposable.Container, org.comroid.common.io.FileProcessor, org.comroid.mutatio.ref.ReferenceMap<K,​V,​org.comroid.uniform.cache.Cache.Reference<K,​V>>, org.comroid.mutatio.ref.ReferenceMap.Settable<K,​V,​org.comroid.uniform.cache.Cache.Reference<K,​V>>, org.comroid.uniform.cache.Cache<K,​V>

    public class FileCache<K,​V extends DataContainer<D>,​D>
    extends org.comroid.uniform.cache.BasicCache<K,​V>
    implements org.comroid.uniform.cache.Cache<K,​V>, org.comroid.common.io.FileProcessor, org.comroid.api.Disposable.Container
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.comroid.uniform.cache.Cache

        org.comroid.uniform.cache.Cache.Reference<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.comroid.api.Disposable

        org.comroid.api.Disposable.Basic, org.comroid.api.Disposable.Container, org.comroid.api.Disposable.MultipleExceptions
      • 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>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static com.google.common.flogger.FluentLogger logger  
      • Fields inherited from class org.comroid.uniform.cache.BasicCache

        DEFAULT_LARGE_THRESHOLD
    • Constructor Summary

      Constructors 
      Constructor Description
      FileCache​(org.comroid.uniform.SerializationAdapter<?,​?,​?> seriLib, VarBind<?,​? super D,​?,​K> idBind, org.comroid.api.Junction<K,​java.lang.String> converter, org.comroid.common.io.FileHandle file, int largeThreshold, boolean keyCaching, D dependencyObject)  
      FileCache​(org.comroid.uniform.SerializationAdapter<?,​?,​?> seriLib, VarBind<?,​? super D,​?,​K> idBind, org.comroid.common.io.FileHandle file, int largeThreshold, D dependencyObject)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(V value)  
      <T extends V>
      org.comroid.mutatio.proc.Processor<T>
      autoUpdate​(java.lang.Class<T> type, org.comroid.uniform.node.UniObjectNode data)  
      <T extends V>
      org.comroid.mutatio.proc.Processor<T>
      autoUpdate​(org.comroid.api.Invocable<? super T> creator, org.comroid.uniform.node.UniObjectNode data)  
      <T extends V>
      org.comroid.mutatio.proc.Processor<T>
      autoUpdate​(GroupBind<? super T,​? super D> group, org.comroid.uniform.node.UniObjectNode data)  
      org.comroid.common.io.FileHandle getFile()  
      org.comroid.api.Disposable getUnderlyingDisposable()  
      void reloadData()  
      void storeData()  
      • Methods inherited from class org.comroid.uniform.cache.BasicCache

        containsKey, containsValue, getReference, iterator, large, pipe, size, stream, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.comroid.uniform.cache.Cache

        canProvide, containsKey, containsValue, forEach, getReference, large, pipe, pipe, provide, size, stream, stream
      • Methods inherited from interface org.comroid.api.Disposable

        closeContainer, dispose, disposeThrow
      • Methods inherited from interface org.comroid.api.Disposable.Container

        addChildren, getChildren
      • Methods inherited from interface org.comroid.common.io.FileProcessor

        close
      • 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
    • Field Detail

      • logger

        public static final com.google.common.flogger.FluentLogger logger
    • Constructor Detail

      • FileCache

        public FileCache​(org.comroid.uniform.SerializationAdapter<?,​?,​?> seriLib,
                         VarBind<?,​? super D,​?,​K> idBind,
                         org.comroid.common.io.FileHandle file,
                         int largeThreshold,
                         D dependencyObject)
      • FileCache

        public FileCache​(org.comroid.uniform.SerializationAdapter<?,​?,​?> seriLib,
                         VarBind<?,​? super D,​?,​K> idBind,
                         org.comroid.api.Junction<K,​java.lang.String> converter,
                         org.comroid.common.io.FileHandle file,
                         int largeThreshold,
                         boolean keyCaching,
                         D dependencyObject)
    • Method Detail

      • getFile

        public org.comroid.common.io.FileHandle getFile()
        Specified by:
        getFile in interface org.comroid.common.io.FileProcessor
      • getUnderlyingDisposable

        public org.comroid.api.Disposable getUnderlyingDisposable()
        Specified by:
        getUnderlyingDisposable in interface org.comroid.api.Disposable.Container
      • add

        public boolean add​(V value)
      • autoUpdate

        public final <T extends V> org.comroid.mutatio.proc.Processor<T> autoUpdate​(java.lang.Class<T> type,
                                                                                    org.comroid.uniform.node.UniObjectNode data)
      • autoUpdate

        public final <T extends V> org.comroid.mutatio.proc.Processor<T> autoUpdate​(GroupBind<? super T,​? super D> group,
                                                                                    org.comroid.uniform.node.UniObjectNode data)
      • autoUpdate

        public final <T extends V> org.comroid.mutatio.proc.Processor<T> autoUpdate​(org.comroid.api.Invocable<? super T> creator,
                                                                                    org.comroid.uniform.node.UniObjectNode data)
      • storeData

        public void storeData()
                       throws java.io.IOException
        Specified by:
        storeData in interface org.comroid.common.io.FileProcessor
        Throws:
        java.io.IOException
      • reloadData

        public void reloadData()
                        throws java.io.IOException
        Specified by:
        reloadData in interface org.comroid.common.io.FileProcessor
        Throws:
        java.io.IOException