Package com.tangosol.util
Class ConverterCollections.ConverterMap<FK,TK,FV,TV>
java.lang.Object
com.tangosol.util.ConverterCollections.ConverterMap<FK,TK,FV,TV>
- Type Parameters:
FK
- the type of the keys in the underlying MapTK
- the type that the keys should be converted toFV
- the type of the values in the underlying MapTV
- the type that the values should be converted to
- All Implemented Interfaces:
Serializable
,Map<TK,
TV>
- Direct Known Subclasses:
CacheStoreMap
,ConverterCollections.ConverterConcurrentMap
,ConverterCollections.ConverterInvocableMap
,ConverterCollections.ConverterObservableMap
,ConverterCollections.ConverterQueryMap
,ConverterCollections.ConverterSortedMap
- Enclosing class:
ConverterCollections
public static class ConverterCollections.ConverterMap<FK,TK,FV,TV>
extends Object
implements Map<TK,TV>, Serializable
A Converter Map views an underlying Map through a set of key and value
Converters.
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionThe Converter used to pass keys down to the Map.The Converter used to view keys stored in the Map.The Converter used to pass keys down to the Map.The Converter used to view values stored in the Map.The underlying Map.The Entry Set. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
Return the Converter used to pass keys down to the underlying Map.Return the Converter used to view the underlying Map's keys through.Return the Converter used to pass values down to the underlying Map.Return the Converter used to view the underlying Map's values through.getMap()
Return the underlying Map.int
hashCode()
protected <F,
T> Collection <T> instantiateCollection
(Collection<F> col, Converter<F, T> convUp, Converter<T, F> convDown) Create a Converter Collection.instantiateEntrySet
(Set<Map.Entry<FK, FV>> set, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Create a Converter Entry Set.protected <FK,
TK, FV, TV>
Map<TK, TV> instantiateMap
(Map<FK, FV> map, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Create a Converter Map.protected <T,
F> Set <T> instantiateSet
(Set<F> set, Converter<F, T> convUp, Converter<T, F> convDown) Create a Converter Set.boolean
isEmpty()
keySet()
void
int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
m_map
The underlying Map. -
m_convKeyUp
The Converter used to view keys stored in the Map. -
m_convKeyDown
The Converter used to pass keys down to the Map. -
m_convValUp
The Converter used to view values stored in the Map. -
m_convValDown
The Converter used to pass keys down to the Map. -
m_set
The Entry Set.
-
-
Constructor Details
-
ConverterMap
public ConverterMap(Map<FK, FV> map, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Constructor.- Parameters:
map
- the underlying MapconvKeyUp
- the Converter to view the underlying Map's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying MapconvValUp
- the Converter to view the underlying Map's values throughconvValDown
- the Converter to use to pass values down to the underlying Map
-
-
Method Details
-
subMap
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<FK,
TK>
-
containsValue
- Specified by:
containsValue
in interfaceMap<FK,
TK>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
toString
-
equals
-
hashCode
public int hashCode() -
instantiateCollection
protected <F,T> Collection<T> instantiateCollection(Collection<F> col, Converter<F, T> convUp, Converter<T, F> convDown) Create a Converter Collection.- Type Parameters:
F
- the type of elements in the underlying CollectionT
- the type that the elements should be converted to- Parameters:
col
- the underlying CollectionconvUp
- the Converter to view the underlying Collection throughconvDown
- the Converter to pass items down to the underlying Collection through- Returns:
- a Converter Collection
-
instantiateSet
Create a Converter Set.- Type Parameters:
T
- the type that the elements should be converted toF
- the type of elements in the underlying Set- Parameters:
set
- the underlying SetconvUp
- the Converter to view the underlying Set throughconvDown
- the Converter to pass items down to the underlying Set through- Returns:
- a Converter Set
-
instantiateMap
protected <FK,TK, Map<TK,FV, TV> TV> instantiateMap(Map<FK, FV> map, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Create a Converter Map.- Type Parameters:
FK
- the type of the keys in the underlying MapTK
- the type that the keys should be converted toFV
- the type of the values in the underlying MapTV
- the type that the values should be converted to- Parameters:
map
- the underlying MapconvKeyUp
- the Converter to view the underlying Map's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying MapconvValUp
- the Converter to view the underlying Map's values throughconvValDown
- the Converter to use to pass values down to the underlying Map- Returns:
- a Converter Map
-
instantiateEntrySet
protected Set<Map.Entry<TK,TV>> instantiateEntrySet(Set<Map.Entry<FK, FV>> set, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Create a Converter Entry Set.- Parameters:
set
- the underlying Map Entry SetconvKeyUp
- the Converter to view the underlying Map's Entry Set's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying Map's Entry SetconvValUp
- the Converter to view the underlying Map's Entry Set's values throughconvValDown
- the Converter to use to pass values down to the underlying Map's Entry Set- Returns:
- a Converter Entry Set
-
getMap
Return the underlying Map.- Returns:
- the underlying Map
-
getConverterKeyUp
Return the Converter used to view the underlying Map's keys through.- Returns:
- the Converter from the underlying Map's keys
-
getConverterKeyDown
Return the Converter used to pass keys down to the underlying Map.- Returns:
- the Converter to the underlying Map's keys
-
getConverterValueUp
Return the Converter used to view the underlying Map's values through.- Returns:
- the Converter from the underlying Map's values
-
getConverterValueDown
Return the Converter used to pass values down to the underlying Map.- Returns:
- the Converter to the underlying Map's values
-