Class MarkupCache.DefaultCacheImplementation<K,​V>

  • Type Parameters:
    K -
    V -
    All Implemented Interfaces:
    MarkupCache.ICache<K,​V>
    Enclosing class:
    MarkupCache

    public static class MarkupCache.DefaultCacheImplementation<K,​V>
    extends java.lang.Object
    implements MarkupCache.ICache<K,​V>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear the cache
      boolean containsKey​(java.lang.Object key)
      Check if key is in the cache
      V get​(java.lang.Object key)
      Get the cache element associated with the key
      java.util.Collection<K> getKeys()
      Get all the keys referencing cache entries
      java.util.Collection<V> getValues()
      Get all the values referencing cache entries
      void put​(K key, V value)
      Put an entry into the cache
      boolean remove​(K key)
      Remove an entry from the cache.
      void shutdown()
      Cleanup and shutdown
      int size()
      Get the number of cache entries
      • Methods inherited from class java.lang.Object

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

      • DefaultCacheImplementation

        public DefaultCacheImplementation()
        Construct.
    • Method Detail

      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Description copied from interface: MarkupCache.ICache
        Check if key is in the cache
        Specified by:
        containsKey in interface MarkupCache.ICache<K,​V>
        Returns:
        true if cache contains key key
      • get

        public V get​(java.lang.Object key)
        Description copied from interface: MarkupCache.ICache
        Get the cache element associated with the key
        Specified by:
        get in interface MarkupCache.ICache<K,​V>
        Returns:
        cached object for key key or null if no matches
      • getKeys

        public java.util.Collection<K> getKeys()
        Description copied from interface: MarkupCache.ICache
        Get all the keys referencing cache entries
        Specified by:
        getKeys in interface MarkupCache.ICache<K,​V>
        Returns:
        collection of cached keys
      • getValues

        public java.util.Collection<V> getValues()
        Description copied from interface: MarkupCache.ICache
        Get all the values referencing cache entries
        Specified by:
        getValues in interface MarkupCache.ICache<K,​V>
        Returns:
        collection of cached keys
      • put

        public void put​(K key,
                        V value)
        Description copied from interface: MarkupCache.ICache
        Put an entry into the cache
        Specified by:
        put in interface MarkupCache.ICache<K,​V>
        Parameters:
        key - The reference key to find the element. Must not be null.
        value - The element to be cached. Must not be null.
      • remove

        public boolean remove​(K key)
        Description copied from interface: MarkupCache.ICache
        Remove an entry from the cache.
        Specified by:
        remove in interface MarkupCache.ICache<K,​V>
        Returns:
        true, if found and removed