Class ConverterCollections.ConverterList<F,T>

java.lang.Object
com.tangosol.util.ConverterCollections.ConverterCollection<F,T>
com.tangosol.util.ConverterCollections.ConverterList<F,T>
Type Parameters:
F - the type of elements in the underlying List
T - the type that the elements should be converted to
All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, List<T>, SequencedCollection<T>
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterList<F,T> extends ConverterCollections.ConverterCollection<F,T> implements List<T>, Serializable
A Converter List views an underlying List through a Converter.
See Also:
  • Constructor Details

    • ConverterList

      public ConverterList(List<F> list, Converter<F,T> convUp, Converter<T,F> convDown)
      Constructor.
      Parameters:
      list - the underlying List
      convUp - the Converter from the underlying List
      convDown - the Converter to the underlying List
  • Method Details

    • get

      public T get(int index)
      Specified by:
      get in interface List<F>
    • set

      public T set(int index, T element)
      Specified by:
      set in interface List<F>
    • add

      public void add(int index, T element)
      Specified by:
      add in interface List<F>
    • addAll

      public boolean addAll(int index, Collection<? extends T> col)
      Specified by:
      addAll in interface List<F>
    • remove

      public T remove(int index)
      Specified by:
      remove in interface List<F>
    • indexOf

      public int indexOf(Object o)
      Specified by:
      indexOf in interface List<F>
    • lastIndexOf

      public int lastIndexOf(Object o)
      Specified by:
      lastIndexOf in interface List<F>
    • listIterator

      public ListIterator<T> listIterator()
      Specified by:
      listIterator in interface List<F>
    • listIterator

      public ListIterator<T> listIterator(int index)
      Specified by:
      listIterator in interface List<F>
    • subList

      public List<T> subList(int fromIndex, int toIndex)
      Specified by:
      subList in interface List<F>
    • equals

      public boolean equals(Object o)
      Compares the specified object with this collection for equality.

      Obeys the general contract of Collection.equals.

      Specified by:
      equals in interface Collection<F>
      Specified by:
      equals in interface List<F>
      Overrides:
      equals in class ConverterCollections.ConverterCollection<F,T>
      Parameters:
      o - Object to be compared for equality with this Collection
      Returns:
      true if the specified object is equal to this Collection
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<F>
      Specified by:
      hashCode in interface List<F>
      Overrides:
      hashCode in class Object
    • instantiateList

      protected <F, T> List<T> instantiateList(List<F> list, Converter<F,T> convUp, Converter<T,F> convDown)
      Create a Converter List.
      Type Parameters:
      F - the type of elements in the underlying List
      T - the type that the elements should be converted to
      Parameters:
      list - the underlying List
      convUp - the Converter to view the underlying List through
      convDown - the Converter to pass items down to the underlying List through
      Returns:
      a Converter List
    • instantiateListIterator

      protected <F, T> ListIterator<T> instantiateListIterator(ListIterator<F> iter, Converter<F,T> convUp, Converter<T,F> convDown)
      Create a Converter ListIterator.
      Type Parameters:
      F - the type of elements in the underlying ListIterator
      T - the type that the elements should be converted to
      Parameters:
      iter - the underlying ListIterator
      convUp - the Converter to view the underlying ListIterator through
      convDown - the Converter to pass items down to the underlying ListIterator through
      Returns:
      a Converter ListIterator
    • getList

      public List<F> getList()
      Return the underlying List.
      Returns:
      the underlying List