java.lang.Object | +--org.apache.commons.collections.collection.AbstractCollectionDecorator | +--org.apache.commons.collections.collection.TransformedCollectionKnown Direct Subclasses:
The transformer to use |
TransformedCollection(Collection coll, Transformer transformer) Constructor that wraps (not copies). |
boolean | add(Object object) |
boolean | addAll(Collection coll) |
static Collection | decorate(Collection coll, Transformer transformer) Factory method to create a transforming collection. |
Object | transform(Object object) Transforms an object. |
Collection | transform(Collection coll) Transforms a collection. |
protected final Transformer transformer
protected TransformedCollection(Collection coll, Transformer transformer)
- if collection or transformer is nullpublic boolean add(Object object)
public boolean addAll(Collection coll)
public static Collection decorate(Collection coll, Transformer transformer)
- if collection or transformer is nullprotected Collection transform(Collection coll)
protected Object transform(Object object)
Collection
to transform objects that are added. The add 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.