Package 

Class DiskCacheAdapter

  • All Implemented Interfaces:
    com.mobwith.imgmodule.load.engine.cache.DiskCache

    
    public class DiskCacheAdapter
     implements DiskCache
                        

    A simple class that returns null for all gets and ignores all writes.

    • Method Summary

      Modifier and Type Method Description
      File get(Key key) Get the cache for the value at the given key.
      void put(Key key, DiskCache.Writer writer) Write to a key in the cache.
      void delete(Key key) Remove the key and value from the cache.
      void clear() Clear the cache.
      • Methods inherited from class java.lang.Object

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

      • get

         File get(Key key)

        Get the cache for the value at the given key.

        Note - This is potentially dangerous, someone may write a new value to the file at any pointin time and we won't know about it.

        Parameters:
        key - The key in the cache.
      • put

         void put(Key key, DiskCache.Writer writer)

        Write to a key in the cache. Writer is used so that the cache implementation canperform actions after the write finishes, like commit (via atomic file rename).

        Parameters:
        key - The key to write to.
        writer - An interface that will write data given an OutputStream for the key.
      • delete

         void delete(Key key)

        Remove the key and value from the cache.

        Parameters:
        key - The key to remove.
      • clear

         void clear()

        Clear the cache.