Documentation of 'umontreal.iro.lecuyer.util.TransformingList' Java class
TransformingList
umontreal.iro.lecuyer.util

Class TransformingList<OE,IE>

  • All Implemented Interfaces:
    java.lang.Iterable<OE>, java.util.Collection<OE>, java.util.List<OE>
    Direct Known Subclasses:
    ListWithStat


    public abstract class TransformingList<OE,IE>
    extends java.util.AbstractList<OE>
    Represents a list that dynamically transforms the elements of another list. This abstract class defines a list containing an inner list of elements of a certain type, and provides facilities to convert these inner elements to outer elements of another type. A concrete subclass simply needs to provide methods for converting between the inner and the outer types.@param <IE> the inner type of the elements.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TransformingList(java.util.List<IE> fromList)
      Creates a new transforming list wrapping the inner list fromList.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(int index, OE element) 
      void clear() 
      abstract OE convertFromInnerType(IE e)
      Converts an element in the inner list to an element of the outer type.
      abstract IE convertToInnerType(OE e)
      Converts an element of the outer type to an element for the inner list.
      OE get(int index) 
      java.util.List<IE> getInnerList() 
      java.util.Iterator<OE> iterator() 
      java.util.ListIterator<OE> listIterator() 
      java.util.ListIterator<OE> listIterator(int index) 
      OE remove(int index) 
      OE set(int index, OE element) 
      int size() 
      • Methods inherited from class java.util.AbstractList

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

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

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
      • Methods inherited from interface java.util.Collection

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

        forEach
    • Constructor Detail

      • TransformingList

        public TransformingList(java.util.List<IE> fromList)
        Creates a new transforming list wrapping the inner list fromList.
        Parameters:
        fromList - the inner list.
    • Method Detail

      • getInnerList

        public java.util.List<IE> getInnerList()
      • convertFromInnerType

        public abstract OE convertFromInnerType(IE e)
        Converts an element in the inner list to an element of the outer type.
        Parameters:
        e - the inner element.
        Returns:
        the outer element.
      • convertToInnerType

        public abstract IE convertToInnerType(OE e)
        Converts an element of the outer type to an element for the inner list.
        Parameters:
        e - the outer element.
        Returns:
        the inner element.
      • add

        public void add(int index,
                        OE element)
        Specified by:
        add in interface java.util.List<OE>
        Overrides:
        add in class java.util.AbstractList<OE>
      • clear

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

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

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

        public java.util.ListIterator<OE> listIterator()
        Specified by:
        listIterator in interface java.util.List<OE>
        Overrides:
        listIterator in class java.util.AbstractList<OE>
      • listIterator

        public java.util.ListIterator<OE> listIterator(int index)
        Specified by:
        listIterator in interface java.util.List<OE>
        Overrides:
        listIterator in class java.util.AbstractList<OE>
      • remove

        public OE remove(int index)
        Specified by:
        remove in interface java.util.List<OE>
        Overrides:
        remove in class java.util.AbstractList<OE>
      • set

        public OE set(int index,
                      OE element)
        Specified by:
        set in interface java.util.List<OE>
        Overrides:
        set in class java.util.AbstractList<OE>
      • size

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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.