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 Map
TK - the type that the keys should be converted to
FV - the type of the values in the underlying Map
TV - 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:
  • Field Details

    • m_map

      protected final Map<FK,FV> m_map
      The underlying Map.
    • 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.
    • m_set

      protected transient Set<Map.Entry<TK,TV>> 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 Map
      convKeyUp - the Converter to view the underlying Map's keys through
      convKeyDown - the Converter to use to pass keys down to the underlying Map
      convValUp - the Converter to view the underlying Map's values through
      convValDown - the Converter to use to pass values down to the underlying Map
  • Method Details

    • subMap

      public Map<TK,TV> subMap(Set<TK> setKeys)
    • size

      public int size()
      Specified by:
      size in interface Map<FK,TK>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<FK,TK>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<FK,TK>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<FK,TK>
    • get

      public TV get(Object key)
      Specified by:
      get in interface Map<FK,TK>
    • put

      public TV put(TK key, TV value)
      Specified by:
      put in interface Map<FK,TK>
    • remove

      public TV remove(Object key)
      Specified by:
      remove in interface Map<FK,TK>
    • putAll

      public void putAll(Map<? extends TK,? extends TV> map)
      Specified by:
      putAll in interface Map<FK,TK>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<FK,TK>
    • keySet

      public Set<TK> keySet()
      Specified by:
      keySet in interface Map<FK,TK>
    • values

      public Collection<TV> values()
      Specified by:
      values in interface Map<FK,TK>
    • entrySet

      public Set<Map.Entry<TK,TV>> entrySet()
      Specified by:
      entrySet in interface Map<FK,TK>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<FK,TK>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<FK,TK>
      Overrides:
      hashCode in class Object
    • 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 Collection
      T - the type that the elements should be converted to
      Parameters:
      col - the underlying Collection
      convUp - the Converter to view the underlying Collection through
      convDown - 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:
      T - the type that the elements should be converted to
      F - the type of elements in the underlying Set
      Parameters:
      set - the underlying Set
      convUp - the Converter to view the underlying Set through
      convDown - 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 Map
      TK - the type that the keys should be converted to
      FV - the type of the values in the underlying Map
      TV - the type that the values should be converted to
      Parameters:
      map - the underlying Map
      convKeyUp - the Converter to view the underlying Map's keys through
      convKeyDown - the Converter to use to pass keys down to the underlying Map
      convValUp - the Converter to view the underlying Map's values through
      convValDown - 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 Set
      convKeyUp - the Converter to view the underlying Map's Entry Set's keys through
      convKeyDown - the Converter to use to pass keys down to the underlying Map's Entry Set
      convValUp - the Converter to view the underlying Map's Entry Set's values through
      convValDown - the Converter to use to pass values down to the underlying Map's Entry Set
      Returns:
      a Converter Entry Set
    • getMap

      public Map<FK,FV> getMap()
      Return the underlying Map.
      Returns:
      the underlying Map
    • 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
    • getConverterValueDown

      public Converter<TV,FV> getConverterValueDown()
      Return the Converter used to pass values down to the underlying Map.
      Returns:
      the Converter to the underlying Map's values