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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Converter<TK,FK>
m_convKeyDown
The Converter used to pass keys down to the Map.protected Converter<FK,TK>
m_convKeyUp
The Converter used to view keys stored in the Map.protected Converter<TV,FV>
m_convValDown
The Converter used to pass keys down to the Map.protected Converter<FV,TV>
m_convValUp
The Converter used to view values stored in the Map.protected Map<FK,FV>
m_map
The underlying Map.protected Set<Map.Entry<TK,TV>>
m_set
The Entry Set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<TK,TV>>
entrySet()
boolean
equals(Object o)
TV
get(Object key)
Converter<TK,FK>
getConverterKeyDown()
Return the Converter used to pass keys down to the underlying Map.Converter<FK,TK>
getConverterKeyUp()
Return the Converter used to view the underlying Map's keys through.Converter<TV,FV>
getConverterValueDown()
Return the Converter used to pass values down to the underlying Map.Converter<FV,TV>
getConverterValueUp()
Return the Converter used to view the underlying Map's values through.Map<FK,FV>
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.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.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()
Set<TK>
keySet()
TV
put(TK key, TV value)
void
putAll(Map<? extends TK,? extends TV> map)
TV
remove(Object key)
int
size()
Map<TK,TV>
subMap(Set<TK> setKeys)
String
toString()
Collection<TV>
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 Detail
-
m_convKeyUp
protected final Converter<FK,TK> m_convKeyUp
The Converter used to view keys stored in the Map.
-
m_convKeyDown
protected final Converter<TK,FK> m_convKeyDown
The Converter used to pass keys down to the Map.
-
m_convValUp
protected final Converter<FV,TV> m_convValUp
The Converter used to view values stored in the Map.
-
m_convValDown
protected final Converter<TV,FV> m_convValDown
The Converter used to pass keys down to the Map.
-
-
Constructor Detail
-
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 Detail
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<FK,TK>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<FK,TK>
-
equals
public boolean equals(Object o)
-
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
protected <T,F> Set<T> instantiateSet(Set<F> set, Converter<F,T> convUp, Converter<T,F> convDown)
Create a Converter Set.- Type Parameters:
F
- the type of elements in the underlying SetT
- the type that the elements should be converted to- 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,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.- 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
-
getConverterKeyUp
public Converter<FK,TK> getConverterKeyUp()
Return the Converter used to view the underlying Map's keys through.- Returns:
- the Converter from the underlying Map's keys
-
getConverterKeyDown
public Converter<TK,FK> getConverterKeyDown()
Return the Converter used to pass keys down to the underlying Map.- Returns:
- the Converter to the underlying Map's keys
-
getConverterValueUp
public Converter<FV,TV> getConverterValueUp()
Return the Converter used to view the underlying Map's values through.- Returns:
- the Converter from the underlying Map's values
-
-