Class JPPFSimpleSetCache<E>

java.lang.Object
org.jppf.caching.JPPFSimpleSetCache<E>
Type Parameters:
E - the type of the cache elements.
All Implemented Interfaces:
JPPFCollectionCache<E>

public class JPPFSimpleSetCache<E> extends Object implements JPPFCollectionCache<E>
Cache implementation backed by a Set wihh synchronized access.
Author:
Laurent Cohen
  • Constructor Details

    • JPPFSimpleSetCache

      public JPPFSimpleSetCache()
  • Method Details

    • add

      public void add(E element)
      Description copied from interface: JPPFCollectionCache
      Put an element in the cache.
      Specified by:
      add in interface JPPFCollectionCache<E>
      Parameters:
      element - the element's key for retrival.
    • has

      public boolean has(E element)
      Description copied from interface: JPPFCollectionCache
      Determine whether an element is in the cache.
      Specified by:
      has in interface JPPFCollectionCache<E>
      Parameters:
      element - the element's to lookup.
      Returns:
      true if the element is in the cache, false otherwise.
    • remove

      public E remove(E element)
      Description copied from interface: JPPFCollectionCache
      Remove an element from the cache.
      Specified by:
      remove in interface JPPFCollectionCache<E>
      Parameters:
      element - the element to remove.
      Returns:
      the the removed element if it was in the cache, or null if it wasn't.
    • clear

      public void clear()
      Description copied from interface: JPPFCollectionCache
      Clear the cache. This removes all elements from the cache.
      Specified by:
      clear in interface JPPFCollectionCache<E>