Uses of Interface
org.apache.commons.collections4.Bag
Packages that use Bag
Package
Description
Interfaces and utilities shared across all packages.
Implementations of the
Collection interface.-
Uses of Bag in org.apache.commons.collections4
Subinterfaces of Bag in org.apache.commons.collections4Modifier and TypeInterfaceDescriptioninterfaceSortedBag<E>Defines a type ofBagthat maintains a sorted order among its unique representative members.Fields in org.apache.commons.collections4 declared as BagModifier and TypeFieldDescriptionstatic final BagBagUtils.EMPTY_BAGAn empty unmodifiable bag.static final BagBagUtils.EMPTY_SORTED_BAGAn empty unmodifiable sorted bag.Methods in org.apache.commons.collections4 that return BagModifier and TypeMethodDescriptionstatic <E> Bag<E> BagUtils.collectionBag(Bag<E> bag) Returns a bag that complies to the Collection contract, backed by the given bag.static <E> Bag<E> BagUtils.emptyBag()Gets an emptyBag.static <K,V> Bag <V> MultiMapUtils.getValuesAsBag(MultiValuedMap<K, V> map, K key) Gets a Bag fromMultiValuedMapin a null-safe manner.static <E> Bag<E> BagUtils.predicatedBag(Bag<E> bag, Predicate<? super E> predicate) Returns a predicated (validating) bag backed by the given bag.static <E> Bag<E> BagUtils.synchronizedBag(Bag<E> bag) 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) Returns a transformed bag backed by the given bag.static <E> Bag<E> BagUtils.unmodifiableBag(Bag<? extends E> bag) Returns an unmodifiable view of the given bag.Methods in org.apache.commons.collections4 with parameters of type BagModifier and TypeMethodDescriptionstatic <E> Bag<E> BagUtils.collectionBag(Bag<E> bag) 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) Returns a predicated (validating) bag backed by the given bag.static <E> Bag<E> BagUtils.synchronizedBag(Bag<E> bag) 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) Returns a transformed bag backed by the given bag.static <E> Bag<E> BagUtils.unmodifiableBag(Bag<? extends E> bag) 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 BagModifier and TypeClassDescriptionclassDecorates anotherBagto provide additional behavior.classAbstract implementation of theBaginterface to simplify the creation of subclass implementations.classDecorates anotherSortedBagto provide additional behavior.final classDecorates anotherBagto comply with the Collection contract.final classDecorates anotherSortedBagto comply with the Collection contract.classHashBag<E>ImplementsBag, using aHashMapto provide the data storage.classDecorates anotherBagto validate that additions match a specified predicate.classDecorates anotherSortedBagto validate that additions match a specified predicate.classDecorates anotherBagto synchronize its behavior for a multithreaded environment.classDecorates anotherSortedBagto synchronize its behavior for a multithreaded environment.classDecorates anotherBagto transform objects that are added.classDecorates anotherSortedBagto transform objects that are added.classTreeBag<E>final classDecorates anotherBagto ensure it can't be altered.final classDecorates anotherSortedBagto ensure it can't be altered.Methods in org.apache.commons.collections4.bag that return BagModifier and TypeMethodDescriptionstatic <E> Bag<E> CollectionBag.collectionBag(Bag<E> bag) Factory method to create a bag that complies to the Collection contract.AbstractBagDecorator.decorated()Gets the bag being decorated.PredicatedBag.decorated()Gets the decorated bag.SynchronizedBag.getBag()Gets the bag being decorated.TransformedBag.getBag()Gets the decorated bag.static <E> Bag<E> TransformedBag.transformedBag(Bag<E> bag, Transformer<? super E, ? extends E> transformer) 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) Factory method to create a transforming bag.static <E> Bag<E> UnmodifiableBag.unmodifiableBag(Bag<? extends E> bag) Factory method to create an unmodifiable bag.Methods in org.apache.commons.collections4.bag with parameters of type BagModifier and TypeMethodDescriptionstatic <E> Bag<E> CollectionBag.collectionBag(Bag<E> bag) 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) Factory method to create a predicated (validating) bag.static <E> SynchronizedBag<E> SynchronizedBag.synchronizedBag(Bag<E> bag) Factory method to create a synchronized bag.static <E> Bag<E> TransformedBag.transformedBag(Bag<E> bag, Transformer<? super E, ? extends E> transformer) 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) Factory method to create a transforming bag.static <E> Bag<E> UnmodifiableBag.unmodifiableBag(Bag<? extends E> bag) Factory method to create an unmodifiable bag.Constructors in org.apache.commons.collections4.bag with parameters of type BagModifierConstructorDescriptionprotectedAbstractBagDecorator(Bag<E> bag) Constructor that wraps (not copies).CollectionBag(Bag<E> bag) Constructor that wraps (not copies).protectedPredicatedBag(Bag<E> bag, Predicate<? super E> predicate) Constructor that wraps (not copies).protectedSynchronizedBag(Bag<E> bag) Constructor that wraps (not copies).protectedSynchronizedBag(Bag<E> bag, Object lock) Constructor that wraps (not copies).protectedSynchronizedSortedBag(Bag<E> bag, Object lock) Constructor that wraps (not copies).protectedTransformedBag(Bag<E> bag, Transformer<? super E, ? extends E> transformer) Constructor that wraps (not copies). -
Uses of Bag in org.apache.commons.collections4.collection
Methods in org.apache.commons.collections4.collection that return BagModifier and TypeMethodDescriptionPredicatedCollection.Builder.createPredicatedBag()Create a new predicated bag filled with the accepted elements.PredicatedCollection.Builder.createPredicatedBag(Bag<E> bag) Decorates the given bag with validating behavior using the predicate.Methods in org.apache.commons.collections4.collection with parameters of type BagModifier and TypeMethodDescriptionPredicatedCollection.Builder.createPredicatedBag(Bag<E> bag) Decorates the given bag with validating behavior using the predicate.