Class LRUCache<Path,​V>

  • All Implemented Interfaces:
    Cache<Path,​V>

    public abstract class LRUCache<Path,​V>
    extends Object
    implements Cache<Path,​V>
    A simple LRU cache keyed on Paths
    • Constructor Detail

      • LRUCache

        public LRUCache()
      • LRUCache

        public LRUCache​(int maxEntries)
    • Method Detail

      • getEntry

        public V getEntry​(Path path)
        Description copied from interface: Cache
        Retrieve the cache entry for the specified key.
        Specified by:
        getEntry in interface Cache<Path,​V>
        Parameters:
        path - The cache entry key
        Returns:
        V The cache entry
      • setEntry

        public void setEntry​(Path path,
                             V value)
        Description copied from interface: Cache
        Set the cache entry for the specified path.
        Specified by:
        setEntry in interface Cache<Path,​V>
        Parameters:
        path - The cache entry key
        value - The cache entry
      • invalidateCache

        public void invalidateCache()
        Description copied from interface: Cache
        Invalidate the entire cache
        Specified by:
        invalidateCache in interface Cache<Path,​V>
      • invalidateCache

        public void invalidateCache​(Path path)
        Description copied from interface: Cache
        Invalidate the cache for a specific key.
        Specified by:
        invalidateCache in interface Cache<Path,​V>
        Parameters:
        path - The cache entry key
      • getKeys

        public Set<Path> getKeys()