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

  • Type Parameters:
    FK - the type of the keys in the underlying EntrySet
    TK - the type that the keys should be converted to
    FV - the type of the values in the underlying EntrySet
    TV - the type that the values should be converted to
    All Implemented Interfaces:
    Serializable, Iterable<Map.Entry<TK,​TV>>, Collection<Map.Entry<TK,​TV>>, Set<Map.Entry<TK,​TV>>
    Enclosing class:
    ConverterCollections

    public static class ConverterCollections.ConverterEntrySet<FK,​TK,​FV,​TV>
    extends Object
    implements Set<Map.Entry<TK,​TV>>, Serializable
    A Converter Entry Set views an underlying Entry Set through a set of key and value Converters.
    See Also:
    Serialized Form
    • Field Detail

      • m_set

        protected final Collection<Map.Entry<FK,​FV>> m_set
        The underlying Entry Set (or Collection of Map Entry objects).
      • m_convKeyUp

        protected final Converter<FK,​TK> m_convKeyUp
        The Converter used to view keys stored in the Entry Set.
      • m_convKeyDown

        protected final Converter<TK,​FK> m_convKeyDown
        The Converter used to pass keys down to the Entry Set.
      • m_convValUp

        protected final Converter<FV,​TV> m_convValUp
        The Converter used to view values stored in the Entry Set.
      • m_convValDown

        protected final Converter<TV,​FV> m_convValDown
        The Converter used to pass values down to the Entry Set.
    • Constructor Detail

      • ConverterEntrySet

        public ConverterEntrySet​(Collection<Map.Entry<FK,​FV>> set,
                                 Converter<FK,​TK> convKeyUp,
                                 Converter<TK,​FK> convKeyDown,
                                 Converter<FV,​TV> convValUp,
                                 Converter<TV,​FV> convValDown)
        Constructor.
        Parameters:
        set - the underlying Entry Set (or Collection of Map Entry objects)
        convKeyUp - the Converter to view the underlying Entry Set's keys through
        convKeyDown - the Converter to use to pass keys down to the underlying Entry Set
        convValUp - the Converter to view the underlying Entry Set's values through
        convValDown - the Converter to use to pass values down to the underlying Entry Set
    • Method Detail

      • instantiateEntrySet

        protected <FK,​FV,​TK,​TV> Set<Map.Entry<TK,​TV>> instantiateEntrySet​(Collection<Map.Entry<FK,​FV>> col,
                                                                                                  Converter<FK,​TK> convKeyUp,
                                                                                                  Converter<TK,​FK> convKeyDown,
                                                                                                  Converter<FV,​TV> convValUp,
                                                                                                  Converter<TV,​FV> convValDown)
        Create a Converter Entry Set.
        Type Parameters:
        FK - the type of the keys in the underlying EntrySet
        TK - the type that the keys should be converted to
        FV - the type of the values in the underlying EntrySet
        TV - the type that the values should be converted to
        Parameters:
        col - the underlying Collection of Map Entry objects
        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
      • wrapEntry

        protected Map.Entry<TK,​TV> wrapEntry​(Map.Entry<FK,​FV> entry)
        Wrap an Entry from the Entry Set to make a Converter Entry.
        Parameters:
        entry - a Map Entry to wrap
        Returns:
        a Map Entry that restricts its type
      • wrapIterator

        protected Iterator<Map.Entry<TK,​TV>> wrapIterator​(Iterator<Map.Entry<FK,​FV>> iter)
        Wrap an Iterator from the Entry Set to make a Converter Iterator.
        Parameters:
        iter - a Iterator to wrap
        Returns:
        a Converter Iterator
      • getEntrySet

        public Collection<Map.Entry<FK,​FV>> getEntrySet()
        Return the underlying Entry Set.
        Returns:
        the underlying Entry Set
      • getConverterKeyUp

        public Converter<FK,​TK> getConverterKeyUp()
        Return the Converter used to view the underlying Entry Set's keys through.
        Returns:
        the Converter from the underlying Entry Set's keys
      • getConverterKeyDown

        public Converter<TK,​FK> getConverterKeyDown()
        Return the Converter used to pass keys down to the underlying Entry Set.
        Returns:
        the Converter to the underlying Entry Set's keys
      • getConverterValueUp

        public Converter<FV,​TV> getConverterValueUp()
        Return the Converter used to view the underlying Entry Set's values through.
        Returns:
        the Converter from the underlying Entry Set's values
      • getConverterValueDown

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