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

java.lang.Object
com.tangosol.util.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:
  • Field Details

    • 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 Details

    • 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 Details

    • size

      public int size()
      Specified by:
      size in interface Collection<FK>
      Specified by:
      size in interface Set<FK>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<FK>
      Specified by:
      isEmpty in interface Set<FK>
    • contains

      public boolean contains(Object o)
      Specified by:
      contains in interface Collection<FK>
      Specified by:
      contains in interface Set<FK>
    • iterator

      public Iterator<Map.Entry<TK,TV>> iterator()
      Specified by:
      iterator in interface Collection<FK>
      Specified by:
      iterator in interface Iterable<FK>
      Specified by:
      iterator in interface Set<FK>
    • toArray

      public Object[] toArray()
      Specified by:
      toArray in interface Collection<FK>
      Specified by:
      toArray in interface Set<FK>
    • toArray

      public <T> T[] toArray(T[] ao)
      Specified by:
      toArray in interface Collection<FK>
      Specified by:
      toArray in interface Set<FK>
    • add

      public boolean add(Map.Entry<TK,TV> o)
      Specified by:
      add in interface Collection<FK>
      Specified by:
      add in interface Set<FK>
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<FK>
      Specified by:
      remove in interface Set<FK>
    • containsAll

      public boolean containsAll(Collection<?> col)
      Specified by:
      containsAll in interface Collection<FK>
      Specified by:
      containsAll in interface Set<FK>
    • addAll

      public boolean addAll(Collection<? extends Map.Entry<TK,TV>> col)
      Specified by:
      addAll in interface Collection<FK>
      Specified by:
      addAll in interface Set<FK>
    • removeAll

      public boolean removeAll(Collection<?> col)
      Specified by:
      removeAll in interface Collection<FK>
      Specified by:
      removeAll in interface Set<FK>
    • retainAll

      public boolean retainAll(Collection<?> col)
      Specified by:
      retainAll in interface Collection<FK>
      Specified by:
      retainAll in interface Set<FK>
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<FK>
      Specified by:
      clear in interface Set<FK>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<FK>
      Specified by:
      equals in interface Set<FK>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<FK>
      Specified by:
      hashCode in interface Set<FK>
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
      FV - the type of the values in the underlying EntrySet
      TK - the type that the keys should be converted to
      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