Skip navigation links

Oracle® Coherence Java API Reference


Class ConverterCollections.ConverterCacheMap

  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterCollections.ConverterMap
          extended by com.tangosol.util.ConverterCollections.ConverterObservableMap
              extended by com.tangosol.util.ConverterCollections.ConverterCacheMap

All Implemented Interfaces:
CacheMap, ObservableMap,, java.util.Map
Direct Known Subclasses:
Enclosing class:

public static class ConverterCollections.ConverterCacheMap
extends ConverterCollections.ConverterObservableMap
implements CacheMap,

A Converter CacheMap views an underlying CacheMap through a set of key and value Converters.

Nested Class Summary


Nested classes/interfaces inherited from interface java.util.Map


Field Summary


Fields inherited from class com.tangosol.util.ConverterCollections.ConverterMap
m_convKeyDown, m_convKeyUp, m_convValDown, m_convValUp, m_map, m_set


Fields inherited from interface


Constructor Summary
ConverterCollections.ConverterCacheMap(CacheMap map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)


Method Summary
 java.util.Map getAll(java.util.Collection colKeys)
          Get all the specified keys, if they are in the cache.
 CacheMap getCacheMap()
          Return the underlying CacheMap.
 java.lang.Object put(java.lang.Object oKey, java.lang.Object oValue, long cMillis)
          Associates the specified value with the specified key in this cache.


Methods inherited from class com.tangosol.util.ConverterCollections.ConverterObservableMap
addMapListener, addMapListener, addMapListener, getConverterListener, getObservableMap, removeMapListener, removeMapListener, removeMapListener


Methods inherited from class com.tangosol.util.ConverterCollections.ConverterMap
clear, containsKey, containsValue, entrySet, get, getConverterKeyDown, getConverterKeyUp, getConverterValueDown, getConverterValueUp, getMap, instantiateCollection, instantiateEntrySet, instantiateMap, instantiateSet, isEmpty, keySet, put, putAll, remove, size, toString, values


Methods inherited from interface


Methods inherited from interface com.tangosol.util.ObservableMap
addMapListener, addMapListener, addMapListener, removeMapListener, removeMapListener, removeMapListener


Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values


Constructor Detail


public ConverterCollections.ConverterCacheMap(CacheMap map,
                                              Converter convKeyUp,
                                              Converter convKeyDown,
                                              Converter convValUp,
                                              Converter convValDown)
map - the underlying CacheMap
convKeyUp - the Converter to view the underlying CacheMap's keys through
convKeyDown - the Converter to use to pass keys down to the underlying CacheMap
convValUp - the Converter to view the underlying CacheMap's values through
convValDown - the Converter to use to pass values down to the underlying CacheMap

Method Detail


public java.util.Map getAll(java.util.Collection colKeys)
Get all the specified keys, if they are in the cache. For each key that is in the cache, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded. 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 =;
     Object oVal = get(oKey);
     if (oVal != null || containsKey(oKey))
         map.put(oKey, oVal);
 return map;
Specified by:
getAll in interface CacheMap
colKeys - a collection of keys that may be in the named cache
a Map of keys to values for the specified keys passed in colKeys


public java.lang.Object put(java.lang.Object oKey,
                            java.lang.Object oValue,
                            long cMillis)
Associates the specified value with the specified key in this cache. If the cache previously contained a mapping for this key, the old value is replaced. This variation of the CacheMap.put(Object oKey, Object oValue) method allows the caller to specify an expiry (or "time to live") for the cache entry.
Specified by:
put in interface CacheMap
oKey - key with which the specified value is to be associated
oValue - value to be associated with the specified key
cMillis - 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()
previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values


public CacheMap getCacheMap()
Return the underlying CacheMap.
the underlying CacheMap

Skip navigation links

Oracle® Coherence Java API Reference


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.