public static class ConverterCollections.ConverterCacheMap<FK,TK,FV,TV> extends ConverterCollections.ConverterObservableMap<FK,TK,FV,TV> implements CacheMap<TK,TV>, Serializable
m_convKeyDown, m_convKeyUp, m_convValDown, m_convValUp, m_map, m_set
EXPIRY_DEFAULT, EXPIRY_NEVER
Constructor and Description |
---|
ConverterCacheMap(CacheMap<FK,FV> map,
Converter<FK,TK> convKeyUp,
Converter<TK,FK> convKeyDown,
Converter<FV,TV> convValUp,
Converter<TV,FV> convValDown)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Map<TK,TV> |
getAll(Collection<? extends TK> colKeys)
Get all the specified keys, if they are in the cache.
|
CacheMap<FK,FV> |
getCacheMap()
Return the underlying CacheMap.
|
TV |
put(TK key,
TV value,
long cMillis)
Associates the specified value with the specified key in this cache.
|
addMapListener, addMapListener, addMapListener, getConverterListener, getObservableMap, removeMapListener, removeMapListener, removeMapListener
clear, containsKey, containsValue, entrySet, equals, get, getConverterKeyDown, getConverterKeyUp, getConverterValueDown, getConverterValueUp, getMap, hashCode, instantiateCollection, instantiateEntrySet, instantiateMap, instantiateSet, isEmpty, keySet, put, putAll, remove, size, toString, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addMapListener, addMapListener, addMapListener, removeMapListener, removeMapListener, removeMapListener
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public ConverterCacheMap(CacheMap<FK,FV> map, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
map
- the underlying CacheMapconvKeyUp
- the Converter to view the underlying CacheMap's
keys throughconvKeyDown
- the Converter to use to pass keys down to the
underlying CacheMapconvValUp
- the Converter to view the underlying CacheMap's
values throughconvValDown
- the Converter to use to pass values down to the
underlying CacheMappublic Map<TK,TV> getAll(Collection<? extends TK> colKeys)
The result of this method is defined to be semantically the same as the following implementation, without regards to threading issues:
Map map = new AnyMap(); // could be a HashMap (but does not have to) for (Iterator iter = colKeys.iterator(); iter.hasNext(); ) { Object oKey = iter.next(); Object oVal = get(oKey); if (oVal != null || containsKey(oKey)) { map.put(oKey, oVal); } } return map;
public TV put(TK key, TV value, long cMillis)
CacheMap.put(Object oKey, Object oValue)
method allows the caller to specify an expiry (or "time to live")
for the cache entry.put
in interface CacheMap<TK,TV>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keycMillis
- the number of milliseconds until the cache entry will
expire, also referred to as the entry's "time to live";
pass CacheMap.EXPIRY_DEFAULT
to use the cache's default
time-to-live setting; pass CacheMap.EXPIRY_NEVER
to
indicate that the cache entry should never expire; this
milliseconds value is not a date/time value, such
as is returned from System.currentTimeMillis()