Package com.landawn.abacus.cache
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 typeV- the value type
- All Implemented Interfaces:
Cache<K,,V> Closeable,AutoCloseable
- Since:
- 0.8
- Author:
- Haiyang Li
-
Field Summary
Fields inherited from interface com.landawn.abacus.cache.Cache
DEFAULT_LIVE_TIME, DEFAULT_MAX_IDLE_TIME -
Constructor Summary
ConstructorsConstructorDescriptionLocalCache(int capacity, long evictDelay) LocalCache(int capacity, long evictDelay, long defaultLiveTime, long defaultMaxIdleTime) LocalCache(long defaultLiveTime, long defaultMaxIdleTime, com.landawn.abacus.pool.KeyedObjectPool<K, com.landawn.abacus.pool.PoolableWrapper<V>> pool) -
Method Summary
Methods inherited from class com.landawn.abacus.cache.AbstractCache
asyncContainsKey, asyncGet, asyncGett, asyncPut, asyncPut, asyncRemove, get, getProperties, getProperty, put, removeProperty, setProperty
-
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
Gets the t.- Parameters:
key-- Returns:
-
put
- Parameters:
key-value-liveTime-maxIdleTime-- Returns:
- true, if successful
-
remove
- Parameters:
key-
-
containsKey
- Parameters:
key-- Returns:
- true, if successful
-
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
-