java.lang.Object | +--org.apache.commons.collections.collection.AbstractCollectionDecorator | +--org.apache.commons.collections.collection.TransformedCollection | +--org.apache.commons.collections.bag.TransformedBagAll Implemented Interfaces:
TransformedBag(Bag bag, Transformer transformer) Constructor that wraps (not copies). |
boolean | add(Object object, int nCopies) |
static Bag | decorate(Bag bag, Transformer transformer) Factory method to create a transforming bag. |
getBag() Gets the decorated bag. | |
int | getCount(Object object) |
boolean | remove(Object object, int nCopies) |
Set |
protected TransformedBag(Bag bag, Transformer transformer)
- if bag or transformer is nullpublic boolean add(Object object, int nCopies)
public static Bag decorate(Bag bag, Transformer transformer)
- if bag or transformer is nullprotected Bag getBag()
public int getCount(Object object)
public boolean remove(Object object, int nCopies)
public Set uniqueSet()
Bag
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.