Class TransformedList<E>

All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>

public class TransformedList<E> extends TransformedCollection<E> implements List<E>
Decorates another List to transform objects that are added.

The add and set methods are affected by this class. Thus objects must be removed or searched for using their transformed form. For example, if the transformation converts Strings to Integers, you must use the Integer form to remove objects.

This class is Serializable from Commons Collections 3.1.

Since:
3.0
See Also:
  • Constructor Details

    • TransformedList

      protected TransformedList(List<E> list, Transformer<? super E,? extends E> transformer)
      Constructor that wraps (not copies).

      If there are any elements already in the list being decorated, they are NOT transformed.

      Parameters:
      list - the list to decorate, must not be null
      transformer - the transformer to use for conversion, must not be null
      Throws:
      NullPointerException - if list or transformer is null
  • Method Details