Class WeakCache<K>

java.lang.Object
org.semanticweb.owlapi.util.WeakCache<K>
Type Parameters:
K - cached type
All Implemented Interfaces:
Serializable

public class WeakCache<K> extends Object implements Serializable
A weakly linked cache - elements in the cache can be garbage collected.
See Also:
  • Constructor Details

    • WeakCache

      public WeakCache()
  • Method Details

    • cache

      public K cache(K s)
      Parameters:
      s - the value to cache
      Returns:
      the cached value
    • contains

      public boolean contains(K k)
      Parameters:
      k - the key to check
      Returns:
      true if the cache contains k as a key; note that, due to the nature of this cache, by the time the method returns the key may no longer be in the map.
    • clear

      public void clear()
      empty the cache.