public abstract class MultiKeyCache<K1,K2,V> extends Object implements IMultiKeyCache<K1,K2,V>
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<K1,K2> |
firstKey2SecondKeyMap |
protected Map<K1,V> |
firstKeyCacheMap |
protected Map<K2,V> |
secondKeyCacheMap |
| 构造器和说明 |
|---|
MultiKeyCache() |
MultiKeyCache(int initialCapacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
V |
getFirstKeyFirst(K1 firstKey,
K2 secondKey)
优先从First Key中获取数据,如果First Key为空,则会根据Second Key进行获取。
|
V |
getKey1Only(K1 firstKey)
只根据First Key 从缓存中查找数据
|
V |
getKey2Only(K2 secondKey)
只根据Second Key 从缓存中查找数据
|
V |
getSecondKeyFirst(K1 firstKey,
K2 secondKey)
优先从Second Key中获取数据,如果First Key为空,则会根据Second Key进行获取。
|
K2 |
getSecondKeyViaFirstKey(K1 key1) |
V |
put(K1 firstKey,
K2 secondKey,
V cacheValue) |
void |
remove(K1 key1) |
int |
size() |
Collection<V> |
values() |
public MultiKeyCache()
public MultiKeyCache(int initialCapacity)
public int size()
public void clear()
public void remove(K1 key1)
public K2 getSecondKeyViaFirstKey(K1 key1)
getSecondKeyViaFirstKey 在接口中 IMultiKeyCache<K1,K2,V>public Collection<V> values()
public V getFirstKeyFirst(K1 firstKey, K2 secondKey)
firstKey - The First Key to find the object in Cache.secondKey - The Second Key to find the object in Cache.public V getSecondKeyFirst(K1 firstKey, K2 secondKey)
firstKey - The First Key to find the object in Cache.secondKey - The Second Key to find the object in Cache.public V getKey1Only(K1 firstKey)
firstKey - The First Key to find the object in Cache.Copyright © 2022–2023. All rights reserved.