パッケージ org.postgresql.util
クラス LruCache<Key,Value extends CanEstimateSize>
java.lang.Object
org.postgresql.util.LruCache<Key,Value>
- すべての実装されたインタフェース:
Gettable<Key,
Value>
public class LruCache<Key,Value extends CanEstimateSize>
extends Object
implements Gettable<Key,Value>
Caches values in simple least-recently-accessed order.
-
ネストされたクラスの概要
ネストされたクラス修飾子とタイプクラス説明static interface
When the entry is not present in cache, this create action is used to create one.static interface
Action that is invoked when the entry is removed from the cache. -
コンストラクタの概要
コンストラクタコンストラクタ説明LruCache
(int maxSizeEntries, long maxSizeBytes, boolean accessOrder) LruCache
(int maxSizeEntries, long maxSizeBytes, boolean accessOrder, @Nullable LruCache.CreateAction<Key, Value> createAction, @Nullable LruCache.EvictAction<Value> onEvict) -
メソッドの概要
-
コンストラクタの詳細
-
LruCache
public LruCache(int maxSizeEntries, long maxSizeBytes, boolean accessOrder) -
LruCache
public LruCache(int maxSizeEntries, long maxSizeBytes, boolean accessOrder, @Nullable LruCache.CreateAction<Key, Value> createAction, @Nullable LruCache.EvictAction<Value> onEvict)
-
-
メソッドの詳細
-
get
Returns an entry from the cache.- 定義:
get
インタフェース内Gettable<Key,
Value extends CanEstimateSize> - パラメータ:
key
- cache key- 戻り値:
- entry from cache or null if cache does not contain given key.
-
borrow
Borrows an entry from the cache.- パラメータ:
key
- cache key- 戻り値:
- entry from cache or newly created entry if cache does not contain given key.
- 例外:
SQLException
- if entry creation fails
-
put
Returns given value to the cache.- パラメータ:
key
- keyvalue
- value
-
putAll
Puts all the values from the given map into the cache.- パラメータ:
m
- The map containing entries to put into the cache
-