Class ConverterCollections.ConverterList<F,​T>

    • Constructor Detail

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

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