Class LocalCache<K,V>

java.lang.Object
com.landawn.abacus.cache.AbstractCache<K,V>
com.landawn.abacus.cache.LocalCache<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Cache<K,V>, Closeable, AutoCloseable

public class LocalCache<K,V> extends AbstractCache<K,V>
Since:
0.8
Author:
Haiyang Li
  • Constructor Details

    • LocalCache

      public LocalCache(int capacity, long evictDelay)
      Parameters:
      capacity -
      evictDelay -
    • LocalCache

      public LocalCache(int capacity, long evictDelay, long defaultLiveTime, long defaultMaxIdleTime)
      Parameters:
      capacity -
      evictDelay -
      defaultLiveTime -
      defaultMaxIdleTime -
    • LocalCache

      public LocalCache(long defaultLiveTime, long defaultMaxIdleTime, com.landawn.abacus.pool.KeyedObjectPool<K,com.landawn.abacus.pool.PoolableWrapper<V>> pool)
      Parameters:
      defaultLiveTime -
      defaultMaxIdleTime -
      pool -
  • Method Details

    • gett

      public V gett(K key)
      Gets the t.
      Parameters:
      key -
      Returns:
    • put

      public boolean put(K key, V value, long liveTime, long maxIdleTime)
      Parameters:
      key -
      value -
      liveTime -
      maxIdleTime -
      Returns:
      true, if successful
    • remove

      public void remove(K key)
      Parameters:
      key -
    • containsKey

      public boolean containsKey(K key)
      Parameters:
      key -
      Returns:
      true, if successful
    • keySet

      public Set<K> keySet()
      Returns:
    • size

      public int size()
      Returns:
    • clear

      public void clear()
      Clear.
    • close

      public void close()
      Close.
    • isClosed

      public boolean isClosed()
      Checks if is closed.
      Returns:
      true, if is closed