Interface JPPFMapCache<K,V>

Type Parameters:
K - the type of keys.
V - the type of values.
All Known Implementing Classes:
AbstractJPPFMapCache, JPPFHashMapCache, JPPFLRUMapCache, JPPFSynchronizedSoftCache

public interface JPPFMapCache<K,V>
Interface for caches implementations with a map-like API.
Author:
Laurent Cohen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the cache.
    get(K key)
    Get an element in the cache.
    boolean
    has(K key)
    Determine whether an entry with the specified key is in the cache.
    void
    put(K key, V value)
    Put an element in the cache.
    remove(K key)
    Remove an element from the cache.
  • Method Details

    • put

      void put(K key, V value)
      Put an element in the cache.
      Parameters:
      key - the element's key for retrival.
      value - the element's value.
    • has

      boolean has(K key)
      Determine whether an entry with the specified key is in the cache.
      Parameters:
      key - the key to look up.
      Returns:
      true if the key is in the cache, false otherwise.
    • get

      V get(K key)
      Get an element in the cache.
      Parameters:
      key - the element's key.
      Returns:
      the value of the element, or null if the element is not in the cache.
    • remove

      V remove(K key)
      Remove an element from the cache.
      Parameters:
      key - the element's key.
      Returns:
      the value of the removed element, or null if the element is not in the cache.
    • clear

      void clear()
      Clear the cache. This removes all elements from the cache.