public class TransformedList extends TransformedCollection implements List
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.
| Modifier and Type | Class and Description |
|---|---|
protected class |
TransformedList.TransformedListIterator
Inner class Iterator for the TransformedList
|
transformercollection| Modifier | Constructor and Description |
|---|---|
protected |
TransformedList(List list,
Transformer transformer)
Constructor that wraps (not copies).
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Object object) |
boolean |
addAll(int index,
Collection coll) |
static List |
decorate(List list,
Transformer transformer)
Factory method to create a transforming list.
|
Object |
get(int index) |
protected List |
getList()
Gets the decorated list.
|
int |
indexOf(Object object) |
int |
lastIndexOf(Object object) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int i) |
Object |
remove(int index) |
Object |
set(int index,
Object object) |
List |
subList(int fromIndex,
int toIndex) |
add, addAll, decorate, transform, transformclear, contains, containsAll, equals, getCollection, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toStringprotected TransformedList(List list, Transformer transformer)
If there are any elements already in the list being decorated, they are NOT transformed.
list - the list to decorate, must not be nulltransformer - the transformer to use for conversion, must not be nullIllegalArgumentException - if list or transformer is nullpublic static List decorate(List list, Transformer transformer)
If there are any elements already in the list being decorated, they are NOT transformed.
list - the list to decorate, must not be nulltransformer - the transformer to use for conversion, must not be nullIllegalArgumentException - if list or transformer is nullprotected List getList()
public int lastIndexOf(Object object)
lastIndexOf in interface Listpublic boolean addAll(int index,
Collection coll)
public ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int i)
listIterator in interface ListCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.