Class WeakIndexCache<K,V>

java.lang.Object
org.semanticweb.owlapi.util.WeakIndexCache<K,V>
Type Parameters:
K - key type
V - value type
All Implemented Interfaces:
Serializable

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

    • WeakIndexCache

      public WeakIndexCache()
  • Method Details

    • cache

      public V cache(K s, V v)
      Parameters:
      s - the cache key
      v - the cache value
      Returns:
      the cached value
    • get

      @Nullable public V get(K k)
      Parameters:
      k - the key
      Returns:
      the 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.