Interface EvictableCache<K,​V>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  EvictableCache.EvictionStrategy
      Represents a eviction strategy for the cache with limited size
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Map<K,​V> clearAll()
      Clear the cache
      boolean containsKey​(java.lang.Object key)
      Determines if the cache contains an entry for the specified key.
      java.util.Set<K> keys()
      Get all keys associated to cached values
      V remove​(java.lang.Object key)
      Remove the cached value by the key
      int size()
      Get the size of the cache
      java.util.Collection<V> values()
      Get all cached values
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, replace, replace, replaceAll
    • Method Detail

      • remove

        V remove​(java.lang.Object key)
        Remove the cached value by the key
        Specified by:
        remove in interface java.util.Map<K,​V>
        Parameters:
        key - of the cached value
        Returns:
        returns the removed value
      • clearAll

        java.util.Map<K,​V> clearAll()
        Clear the cache
        Returns:
        returns the content of the cleared map
      • values

        java.util.Collection<V> values()
        Get all cached values
        Specified by:
        values in interface java.util.Map<K,​V>
        Returns:
        all cached values
      • keys

        java.util.Set<K> keys()
        Get all keys associated to cached values
        Returns:
        all keys
      • containsKey

        boolean containsKey​(java.lang.Object key)
        Determines if the cache contains an entry for the specified key.
        Specified by:
        containsKey in interface java.util.Map<K,​V>
        Parameters:
        key - key whose presence in this cache is to be tested.
        Returns:
        true if the cache contains a mapping for the specified key
      • size

        int size()
        Get the size of the cache
        Specified by:
        size in interface java.util.Map<K,​V>
        Returns:
        the size of the cache