Class ConverterCollections.ConverterMap<FK,​TK,​FV,​TV>

    • Field Detail

      • 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.
    • 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 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 Detail

      • size

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

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

        public TV put​(TK key,
                      TV value)
        Specified by:
        put 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>
      • 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:
        F - the type of elements in the underlying Set
        T - the type that the elements should be converted to
        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