| Package | Description |
|---|---|
| org.apache.commons.collections4 |
This package contains the interfaces and utilities shared across all the subpackages of this component.
|
| org.apache.commons.collections4.bag | |
| org.apache.commons.collections4.collection |
This package contains implementations of the
Collection interface.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
SortedBag<E>
Defines a type of
Bag that maintains a sorted order among its unique representative members.
|
| Modifier and Type | Field and Description |
|---|---|
static Bag |
BagUtils.EMPTY_BAG
An empty unmodifiable bag.
|
static Bag |
BagUtils.EMPTY_SORTED_BAG
An empty unmodifiable sorted bag.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Bag |
BagUtils.collectionBag(Bag
Returns a bag that complies to the Collection contract, backed by the given bag.
|
static <E> Bag |
BagUtils.emptyBag()
Get an empty
Bag.
|
static <K |
MultiMapUtils.getValuesAsBag(MultiValuedMap
Gets a Bag from
MultiValuedMap in a null-safe manner.
|
static <E> Bag |
BagUtils.predicatedBag(Bag
Returns a predicated (validating) bag backed by the given bag.
|
static <E> Bag |
BagUtils.synchronizedBag(Bag
Returns a synchronized (thread-safe) bag backed by the given bag.
|
static <E> Bag |
BagUtils.transformingBag(Bag
Returns a transformed bag backed by the given bag.
|
static <E> Bag |
BagUtils.unmodifiableBag(Bag
Returns an unmodifiable view of the given bag.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Bag |
BagUtils.collectionBag(Bag
Returns a bag that complies to the Collection contract, backed by the given bag.
|
static <E> Bag |
BagUtils.predicatedBag(Bag
Returns a predicated (validating) bag backed by the given bag.
|
static <E> Bag |
BagUtils.synchronizedBag(Bag
Returns a synchronized (thread-safe) bag backed by the given bag.
|
static <E> Bag |
BagUtils.transformingBag(Bag
Returns a transformed bag backed by the given bag.
|
static <E> Bag |
BagUtils.unmodifiableBag(Bag
Returns an unmodifiable view of the given bag.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractBagDecorator<E>
Decorates another
Bag to provide additional behaviour.
|
class |
AbstractMapBag<E>
Abstract implementation of the
Bag interface to simplify the creation of subclass implementations.
|
class |
AbstractSortedBagDecorator<E>
Decorates another
SortedBag to provide additional behaviour.
|
class |
CollectionBag<E>
Decorates another
Bag to comply with the Collection contract.
|
class |
CollectionSortedBag<E>
Decorates another
SortedBag to comply with the Collection contract.
|
class |
HashBag<E>
Implements
Bag, using a
HashMap to provide the data storage.
|
class |
PredicatedBag<E>
Decorates another
Bag to validate that additions match a specified predicate.
|
class |
PredicatedSortedBag<E>
Decorates another
SortedBag to validate that additions match a specified predicate.
|
class |
SynchronizedBag<E>
Decorates another
Bag to synchronize its behaviour for a multi-threaded environment.
|
class |
SynchronizedSortedBag<E>
Decorates another
SortedBag to synchronize its behaviour for a multi-threaded environment.
|
class |
TransformedBag<E>
Decorates another
Bag to transform objects that are added.
|
class |
TransformedSortedBag<E>
Decorates another
SortedBag to transform objects that are added.
|
class |
TreeBag<E>
|
class |
UnmodifiableBag<E>
Decorates another
Bag to ensure it can't be altered.
|
class |
UnmodifiableSortedBag<E>
Decorates another
SortedBag to ensure it can't be altered.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Bag |
CollectionBag.collectionBag(Bag
Factory method to create a bag that complies to the Collection contract.
|
protected Bag |
AbstractBagDecorator.decorated()
Gets the bag being decorated.
|
protected Bag |
PredicatedBag.decorated()
Gets the decorated bag.
|
protected Bag |
TransformedBag.getBag()
Gets the decorated bag.
|
protected Bag |
SynchronizedBag.getBag()
Gets the bag being decorated.
|
static <E> Bag |
TransformedBag.transformedBag(Bag
Factory method to create a transforming bag that will transform existing contents of the specified bag.
|
static <E> Bag |
TransformedBag.transformingBag(Bag
Factory method to create a transforming bag.
|
static <E> Bag |
UnmodifiableBag.unmodifiableBag(Bag
Factory method to create an unmodifiable bag.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Bag |
CollectionBag.collectionBag(Bag
Factory method to create a bag that complies to the Collection contract.
|
static <E> PredicatedBag |
PredicatedBag.predicatedBag(Bag
Factory method to create a predicated (validating) bag.
|
static <E> SynchronizedBag |
SynchronizedBag.synchronizedBag(Bag
Factory method to create a synchronized bag.
|
static <E> Bag |
TransformedBag.transformedBag(Bag
Factory method to create a transforming bag that will transform existing contents of the specified bag.
|
static <E> Bag |
TransformedBag.transformingBag(Bag
Factory method to create a transforming bag.
|
static <E> Bag |
UnmodifiableBag.unmodifiableBag(Bag
Factory method to create an unmodifiable bag.
|
| Constructor and Description | |
|---|---|
AbstractBagDecorator(Bag
Constructor that wraps (not copies).
|
|
CollectionBag(Bag
Constructor that wraps (not copies).
|
|
PredicatedBag(Bag
Constructor that wraps (not copies).
|
|
SynchronizedBag(Bag
Constructor that wraps (not copies).
|
|
SynchronizedBag(Bag
Constructor that wraps (not copies).
|
|
SynchronizedSortedBag(Bag
Constructor that wraps (not copies).
|
|
TransformedBag(Bag
Constructor that wraps (not copies).
|
| Modifier and Type | Method and Description |
|---|---|
Bag |
PredicatedCollection.Builder.createPredicatedBag()
Create a new predicated bag filled with the accepted elements.
|
Bag |
PredicatedCollection.Builder.createPredicatedBag(Bag
Decorates the given bag with validating behavior using the predicate.
|
| Modifier and Type | Method and Description |
|---|---|
Bag |
PredicatedCollection.Builder.createPredicatedBag(Bag
Decorates the given bag with validating behavior using the predicate.
|