Interface JPPFCollectionCache<E>

Type Parameters:
E - the type of elements.
All Known Implementing Classes:
JPPFSimpleSetCache

public interface JPPFCollectionCache<E>
Interface for caches implementations that rely on simple collections (as opposed to maps).
Author:
Laurent Cohen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(E element)
    Put an element in the cache.
    void
    Clear the cache.
    boolean
    has(E element)
    Determine whether an element is in the cache.
    remove(E element)
    Remove an element from the cache.
  • Method Details

    • add

      void add(E element)
      Put an element in the cache.
      Parameters:
      element - the element's key for retrival.
    • has

      boolean has(E element)
      Determine whether an element is in the cache.
      Parameters:
      element - the element's to lookup.
      Returns:
      true if the element is in the cache, false otherwise.
    • remove

      E remove(E element)
      Remove an element from the cache.
      Parameters:
      element - the element to remove.
      Returns:
      the the removed element if it was in the cache, or null if it wasn't.
    • clear

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