⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.bag

Class AbstractBagDecorator

java.lang.Object
|
+--org.apache.commons.collections.collection.AbstractCollectionDecorator
   |
   +--org.apache.commons.collections.bag.AbstractBagDecorator

All Implemented Interfaces:
Collection, Bag

Known Direct Subclasses:
AbstractSortedBagDecorator, UnmodifiableBag


public abstract class AbstractBagDecorator
extends AbstractCollectionDecorator
implements Bag

Decorates another Bag to provide additional behaviour.

Methods are forwarded directly to the decorated bag.

Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

AbstractBagDecorator(Bag bag)

Constructor that wraps (not copies).

Method Summary

boolean

add(Object object, int count)

Bag

getBag()

Gets the bag being decorated.

int

getCount(Object object)

boolean

remove(Object object, int count)

Set

uniqueSet()

Constructor Details

AbstractBagDecorator

protected AbstractBagDecorator(Bag bag)

Constructor that wraps (not copies).

Parameters:
bag - the bag to decorate, must not be null
Throws:
- if list is null

Method Details

add

public boolean add(Object object, int count)

Parameters:
object
count

getBag

protected Bag getBag()

Gets the bag being decorated.

Returns:
the decorated bag

getCount

public int getCount(Object object)

Parameters:
object

remove

public boolean remove(Object object, int count)

Parameters:
object
count

uniqueSet

public Set uniqueSet()