# Uses of Interface
org.apache.commons.collections4.Bag

Packages that use Bag
Package
Description
org.apache.commons.collections4
Interfaces and utilities shared across all packages.
org.apache.commons.collections4.bag
Implements the `Bag` and `SortedBag` interfaces.
org.apache.commons.collections4.collection
Implementations of the `Collection` interface.

- ## Uses of Bag in org.apache.commons.collections4

  Subinterfaces of Bag in org.apache.commons.collections4
  Modifier and Type
  Interface
  Description
  `interface`
  `SortedBag<E>`
  Deprecated.
  Since 4.6.0, use `SortedMultiSet` instead; see the `Bag` Javadoc for migration notes.
  Fields in org.apache.commons.collections4 declared as Bag
  Modifier and Type
  Field
  Description
  `static final Bag`
  BagUtils.`EMPTY_BAG`
  Deprecated.
  An empty unmodifiable bag.
  `static final Bag`
  BagUtils.`EMPTY_SORTED_BAG`
  Deprecated.
  An empty unmodifiable sorted bag.
  Methods in org.apache.commons.collections4 that return Bag
  Modifier and Type
  Method
  Description
  `static <E> Bag<E>`
  BagUtils.`collectionBag(Bag<E> bag)`
  Deprecated.
  Returns a bag that complies to the Collection contract, backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`emptyBag()`
  Deprecated.
  Gets an empty `Bag`.
  `static <K, V> Bag<V>`
  MultiMapUtils.`getValuesAsBag(MultiValuedMap<K,V> map, K key)`
  Deprecated.
  Since 4.6.0, use `MultiMapUtils.getValuesAsMultiSet(MultiValuedMap, Object)` instead.
  `static <E> Bag<E>`
  BagUtils.`predicatedBag(Bag<E> bag, Predicate<? super E> predicate)`
  Deprecated.
  Returns a predicated (validating) bag backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`synchronizedBag(Bag<E> bag)`
  Deprecated.
  Returns a synchronized (thread-safe) bag backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`transformingBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Returns a transformed bag backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`unmodifiableBag(Bag<? extends E> bag)`
  Deprecated.
  Returns an unmodifiable view of the given bag.
  Methods in org.apache.commons.collections4 with parameters of type Bag
  Modifier and Type
  Method
  Description
  `static <E> Bag<E>`
  BagUtils.`collectionBag(Bag<E> bag)`
  Deprecated.
  Returns a bag that complies to the Collection contract, backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`predicatedBag(Bag<E> bag, Predicate<? super E> predicate)`
  Deprecated.
  Returns a predicated (validating) bag backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`synchronizedBag(Bag<E> bag)`
  Deprecated.
  Returns a synchronized (thread-safe) bag backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`transformingBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Returns a transformed bag backed by the given bag.
  `static <E> Bag<E>`
  BagUtils.`unmodifiableBag(Bag<? extends E> bag)`
  Deprecated.
  Returns an unmodifiable view of the given bag.

- ## Uses of Bag in org.apache.commons.collections4.bag

  Classes in org.apache.commons.collections4.bag that implement Bag
  Modifier and Type
  Class
  Description
  `class`
  `AbstractBagDecorator<E>`
  Deprecated.
  Since 4.6.0, use `AbstractMultiSetDecorator` instead.
  `class`
  `AbstractMapBag<E>`
  Deprecated.
  Since 4.6.0, use `AbstractMapMultiSet` instead.
  `class`
  `AbstractSortedBagDecorator<E>`
  Deprecated.
  Since 4.6.0, use `AbstractSortedMultiSetDecorator` instead.
  `final class`
  `CollectionBag<E>`
  Deprecated.
  Since 4.6.0, no longer needed; a `MultiSet` already complies with the `Collection` contract.
  `final class`
  `CollectionSortedBag<E>`
  Deprecated.
  Since 4.6.0, no longer needed; a `SortedMultiSet` already complies with the `Collection` contract.
  `class`
  `HashBag<E>`
  Deprecated.
  Since 4.6.0, use `HashMultiSet` instead.
  `class`
  `PredicatedBag<E>`
  Deprecated.
  Since 4.6.0, use `PredicatedMultiSet` instead.
  `class`
  `PredicatedSortedBag<E>`
  Deprecated.
  Since 4.6.0, use `PredicatedSortedMultiSet` instead.
  `class`
  `SynchronizedBag<E>`
  Deprecated.
  Since 4.6.0, use `SynchronizedMultiSet` instead.
  `class`
  `SynchronizedSortedBag<E>`
  Deprecated.
  Since 4.6.0, use `SynchronizedSortedMultiSet` instead.
  `class`
  `TransformedBag<E>`
  Deprecated.
  Since 4.6.0, use `TransformedMultiSet` instead.
  `class`
  `TransformedSortedBag<E>`
  Deprecated.
  Since 4.6.0, use `TransformedSortedMultiSet` instead.
  `class`
  `TreeBag<E>`
  Deprecated.
  Since 4.6.0, use `TreeMultiSet` instead.
  `final class`
  `UnmodifiableBag<E>`
  Deprecated.
  Since 4.6.0, use `UnmodifiableMultiSet` instead.
  `final class`
  `UnmodifiableSortedBag<E>`
  Deprecated.
  Since 4.6.0, use `UnmodifiableSortedMultiSet` instead.
  Methods in org.apache.commons.collections4.bag that return Bag
  Modifier and Type
  Method
  Description
  `static <E> Bag<E>`
  CollectionBag.`collectionBag(Bag<E> bag)`
  Deprecated.
  Factory method to create a bag that complies to the Collection contract.
  `protected Bag<E>`
  AbstractBagDecorator.`decorated()`
  Deprecated.
  Gets the bag being decorated.
  `protected Bag<E>`
  PredicatedBag.`decorated()`
  Deprecated.
  Gets the decorated bag.
  `protected Bag<E>`
  SynchronizedBag.`getBag()`
  Deprecated.
  Gets the bag being decorated.
  `protected Bag<E>`
  TransformedBag.`getBag()`
  Deprecated.
  Gets the decorated bag.
  `static <E> Bag<E>`
  TransformedBag.`transformedBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Factory method to create a transforming bag that will transform existing contents of the specified bag.
  `static <E> Bag<E>`
  TransformedBag.`transformingBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Factory method to create a transforming bag.
  `static <E> Bag<E>`
  UnmodifiableBag.`unmodifiableBag(Bag<? extends E> bag)`
  Deprecated.
  Factory method to create an unmodifiable bag.
  Methods in org.apache.commons.collections4.bag with parameters of type Bag
  Modifier and Type
  Method
  Description
  `static <E> Bag<E>`
  CollectionBag.`collectionBag(Bag<E> bag)`
  Deprecated.
  Factory method to create a bag that complies to the Collection contract.
  `static <E> PredicatedBag<E>`
  PredicatedBag.`predicatedBag(Bag<E> bag, Predicate<? super E> predicate)`
  Deprecated.
  Factory method to create a predicated (validating) bag.
  `static <E> SynchronizedBag<E>`
  SynchronizedBag.`synchronizedBag(Bag<E> bag)`
  Deprecated.
  Factory method to create a synchronized bag.
  `static <E> Bag<E>`
  TransformedBag.`transformedBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Factory method to create a transforming bag that will transform existing contents of the specified bag.
  `static <E> Bag<E>`
  TransformedBag.`transformingBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Factory method to create a transforming bag.
  `static <E> Bag<E>`
  UnmodifiableBag.`unmodifiableBag(Bag<? extends E> bag)`
  Deprecated.
  Factory method to create an unmodifiable bag.
  Constructors in org.apache.commons.collections4.bag with parameters of type Bag
  Modifier
  Constructor
  Description
  `protected`
  `AbstractBagDecorator(Bag<E> bag)`
  Deprecated.
  Constructor that wraps (not copies).
  ``
  `CollectionBag(Bag<E> bag)`
  Deprecated.
  Constructor that wraps (not copies).
  `protected`
  `PredicatedBag(Bag<E> bag, Predicate<? super E> predicate)`
  Deprecated.
  Constructor that wraps (not copies).
  `protected`
  `SynchronizedBag(Bag<E> bag)`
  Deprecated.
  Constructor that wraps (not copies).
  `protected`
  `SynchronizedBag(Bag<E> bag, Object lock)`
  Deprecated.
  Constructor that wraps (not copies).
  `protected`
  `SynchronizedSortedBag(Bag<E> bag, Object lock)`
  Deprecated.
  Constructor that wraps (not copies).
  `protected`
  `TransformedBag(Bag<E> bag, Transformer<? super E,? extends E> transformer)`
  Deprecated.
  Constructor that wraps (not copies).

- ## Uses of Bag in org.apache.commons.collections4.collection

  Methods in org.apache.commons.collections4.collection that return Bag
  Modifier and Type
  Method
  Description
  `Bag<E>`
  PredicatedCollection.Builder.`createPredicatedBag()`
  Deprecated.
  Since 4.6.0, use `PredicatedCollection.Builder.createPredicatedMultiSet()` instead.
  `Bag<E>`
  PredicatedCollection.Builder.`createPredicatedBag(Bag<E> bag)`
  Deprecated.
  Since 4.6.0, use `PredicatedCollection.Builder.createPredicatedMultiSet(MultiSet)` instead.
  Methods in org.apache.commons.collections4.collection with parameters of type Bag
  Modifier and Type
  Method
  Description
  `Bag<E>`
  PredicatedCollection.Builder.`createPredicatedBag(Bag<E> bag)`
  Deprecated.
  Since 4.6.0, use `PredicatedCollection.Builder.createPredicatedMultiSet(MultiSet)` instead.