Class Lists.TransformingRandomAccessList<F,​T>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess
    Enclosing class:
    Lists

    private static class Lists.TransformingRandomAccessList<F,​T>
    extends java.util.AbstractList<T>
    implements java.util.RandomAccess, java.io.Serializable
    Implementation of a transforming random access list. We try to make as many of these methods pass-through to the source list as possible so that the performance characteristics of the source list and transformed list are similar.
    See Also:
    Lists.transform(java.util.List<F>, com.google.common.base.Function<? super F, ? extends T>)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.List<F> fromList  
      (package private) Function<? super F,​? extends T> function  
      private static long serialVersionUID  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      T get​(int index)  
      boolean isEmpty()  
      java.util.Iterator<T> iterator()  
      java.util.ListIterator<T> listIterator​(int index)  
      T remove​(int index)  
      boolean removeIf​(java.util.function.Predicate<? super T> filter)  
      int size()  
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

      • fromList

        final java.util.List<F> fromList
      • function

        final Function<? super F,​? extends T> function
    • Constructor Detail

      • TransformingRandomAccessList

        TransformingRandomAccessList​(java.util.List<F> fromList,
                                     Function<? super F,​? extends T> function)
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<F>
        Specified by:
        clear in interface java.util.List<F>
        Overrides:
        clear in class java.util.AbstractList<T>
      • get

        public T get​(int index)
        Specified by:
        get in interface java.util.List<F>
        Specified by:
        get in class java.util.AbstractList<T>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.util.Collection<F>
        Specified by:
        iterator in interface java.lang.Iterable<F>
        Specified by:
        iterator in interface java.util.List<F>
        Overrides:
        iterator in class java.util.AbstractList<T>
      • listIterator

        public java.util.ListIterator<T> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<F>
        Overrides:
        listIterator in class java.util.AbstractList<T>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<F>
        Specified by:
        isEmpty in interface java.util.List<F>
        Overrides:
        isEmpty in class java.util.AbstractCollection<T>
      • removeIf

        public boolean removeIf​(java.util.function.Predicate<? super T> filter)
        Specified by:
        removeIf in interface java.util.Collection<F>
      • remove

        public T remove​(int index)
        Specified by:
        remove in interface java.util.List<F>
        Overrides:
        remove in class java.util.AbstractList<T>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<F>
        Specified by:
        size in interface java.util.List<F>
        Specified by:
        size in class java.util.AbstractCollection<T>