Package org.apache.commons.collections4.bag
package org.apache.commons.collections4.bag
Implements the
Bag and
SortedBag interfaces.
A bag stores an object and a count of the number of occurrences of the object.
The following implementations are provided in the package:
- HashBag - implementation that uses a HashMap to store the data
- TreeBag - implementation that uses a TreeMap to store the data
The following decorators are provided in the package:
- Synchronized - synchronizes method access for multithreaded environments
- Unmodifiable - ensures the bag cannot be altered
- Predicated - ensures that only elements that are valid according to a predicate can be added
- Transformed - transforms each element added to the bag
- Collection - ensures compliance with the java.util.Collection contract
-
ClassesClassDescriptionDecorates another
Bagto provide additional behavior.Abstract implementation of theBaginterface to simplify the creation of subclass implementations.Mutable integer class for storing the data.Decorates anotherSortedBagto provide additional behavior.Decorates anotherBagto comply with the Collection contract.Decorates anotherSortedBagto comply with the Collection contract.HashBag<E>ImplementsBag, using aHashMapto provide the data storage.Decorates anotherBagto validate that additions match a specified predicate.Decorates anotherSortedBagto validate that additions match a specified predicate.Decorates anotherBagto synchronize its behavior for a multithreaded environment.Decorates anotherSortedBagto synchronize its behavior for a multithreaded environment.Decorates anotherBagto transform objects that are added.Decorates anotherSortedBagto transform objects that are added.TreeBag<E>Decorates anotherBagto ensure it can't be altered.Decorates anotherSortedBagto ensure it can't be altered.