Tabnine Logo
TransformedList
Code IndexAdd Tabnine to your IDE (free)

How to use
TransformedList
in
org.apache.commons.collections.list

Best Java code snippets using org.apache.commons.collections.list.TransformedList (Showing top 20 results out of 315)

origin: commons-collections/commons-collections

/**
 * Returns a transformed list backed by the given list.
 * <p>
 * Each object is passed through the transformer as it is added to the
 * List. It is important not to use the original list after invoking this 
 * method, as it is a backdoor for adding untransformed objects.
 *
 * @param list  the list to predicate, must not be null
 * @param transformer  the transformer for the list, must not be null
 * @return a transformed list backed by the given list
 * @throws IllegalArgumentException  if the List or Transformer is null
 */
public static List transformedList(List list, Transformer transformer) {
  return TransformedList.decorate(list, transformer);
}

origin: commons-collections/commons-collections

public List subList(int fromIndex, int toIndex) {
  List sub = getList().subList(fromIndex, toIndex);
  return new TransformedList(sub, transformer);
}
origin: commons-collections/commons-collections

public ListIterator listIterator() {
  return listIterator(0);
}
origin: commons-collections/commons-collections

public Object set(int index, Object object) {
  object = transform(object);
  return getList().set(index, object);
}
origin: commons-collections/commons-collections

public int indexOf(Object object) {
  return getList().indexOf(object);
}
origin: commons-collections/commons-collections

/**
 * Factory method to create a transforming list.
 * <p>
 * If there are any elements already in the list being decorated, they
 * are NOT transformed.
 * 
 * @param list  the list to decorate, must not be null
 * @param transformer  the transformer to use for conversion, must not be null
 * @throws IllegalArgumentException if list or transformer is null
 */
public static List decorate(List list, Transformer transformer) {
  return new TransformedList(list, transformer);
}

origin: commons-collections/commons-collections

public boolean addAll(int index, Collection coll) {
  coll = transform(coll);
  return getList().addAll(index, coll);
}
origin: commons-collections/commons-collections

public int lastIndexOf(Object object) {
  return getList().lastIndexOf(object);
}
origin: wildfly/wildfly

/**
 * Factory method to create a transforming list.
 * <p>
 * If there are any elements already in the list being decorated, they
 * are NOT transformed.
 * 
 * @param list  the list to decorate, must not be null
 * @param transformer  the transformer to use for conversion, must not be null
 * @throws IllegalArgumentException if list or transformer is null
 */
public static List decorate(List list, Transformer transformer) {
  return new TransformedList(list, transformer);
}

origin: commons-collections/commons-collections

public void add(int index, Object object) {
  object = transform(object);
  getList().add(index, object);
}
origin: commons-collections/commons-collections

public Object remove(int index) {
  return getList().remove(index);
}
origin: wildfly/wildfly

public List subList(int fromIndex, int toIndex) {
  List sub = getList().subList(fromIndex, toIndex);
  return new TransformedList(sub, transformer);
}
origin: wildfly/wildfly

/**
 * Returns a transformed list backed by the given list.
 * <p>
 * Each object is passed through the transformer as it is added to the
 * List. It is important not to use the original list after invoking this 
 * method, as it is a backdoor for adding untransformed objects.
 *
 * @param list  the list to predicate, must not be null
 * @param transformer  the transformer for the list, must not be null
 * @return a transformed list backed by the given list
 * @throws IllegalArgumentException  if the List or Transformer is null
 */
public static List transformedList(List list, Transformer transformer) {
  return TransformedList.decorate(list, transformer);
}

origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Factory method to create a transforming list.
 * <p>
 * If there are any elements already in the list being decorated, they
 * are NOT transformed.
 * 
 * @param list  the list to decorate, must not be null
 * @param transformer  the transformer to use for conversion, must not be null
 * @throws IllegalArgumentException if list or transformer is null
 */
public static List decorate(List list, Transformer transformer) {
  return new TransformedList(list, transformer);
}
 
origin: wildfly/wildfly

public ListIterator listIterator() {
  return listIterator(0);
}
origin: wildfly/wildfly

public Object set(int index, Object object) {
  object = transform(object);
  return getList().set(index, object);
}
origin: commons-collections/commons-collections

public Object get(int index) {
  return getList().get(index);
}
origin: com.alibaba.citrus.tool/antx-autoexpand

public List subList(int fromIndex, int toIndex) {
  List sub = getList().subList(fromIndex, toIndex);
  return new TransformedList(sub, transformer);
}
origin: commons-collections/commons-collections

public List makeEmptyList() {
  return TransformedList.decorate(new ArrayList(), TestTransformedCollection.NOOP_TRANSFORMER);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Factory method to create a transforming list.
 * <p>
 * If there are any elements already in the list being decorated, they
 * are NOT transformed.
 * 
 * @param list  the list to decorate, must not be null
 * @param transformer  the transformer to use for conversion, must not be null
 * @throws IllegalArgumentException if list or transformer is null
 */
public static List decorate(List list, Transformer transformer) {
  return new TransformedList(list, transformer);
}
 
org.apache.commons.collections.listTransformedList

Javadoc

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.

Most used methods

  • decorate
    Factory method to create a transforming list. If there are any elements already in the list being de
  • <init>
    Constructor that wraps (not copies). If there are any elements already in the list being decorated,
  • getList
    Gets the decorated list.
  • listIterator
  • transform

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JOptionPane (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now