org.apache.commons.collections.bag |
This package contains implementations of the
{@link org.apache.commons.collections.Bag Bag} and
{@link org.apache.commons.collections.SortedBag SortedBag} interfaces.
A bag stores an object and a count of the number of occurences 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 multi-threaded environments
- Unmodifiable - ensures the bag cannot be altered
- Predicated - ensures that only elements that are valid according to a predicate can be added
- Typed - ensures that only elements that are of a specific type can be added
- Transformed - transforms each element added to the bag
|
Java Source File Name | Type | Comment |
AbstractBagDecorator.java | Class | Decorates another Bag to provide additional behaviour. |
AbstractMapBag.java | Class | Abstract implementation of the
Bag interface to simplify the creation
of subclass implementations.
Subclasses specify a Map implementation to use as the internal storage.
The map will be used to map bag elements to a number; the number represents
the number of occurrences of that element in the bag.
since: Commons Collections 3.0 (previously DefaultMapBag v2.0) version: $Revision: 219131 $ $Date: 2005-07-15 00:11:12 +0100 (Fri, 15 Jul 2005) $ author: Chuck Burdick author: Michael A. |
AbstractSortedBagDecorator.java | Class | Decorates another SortedBag to provide additional behaviour. |
AbstractTestBag.java | Class | Abstract test class for
org.apache.commons.collections.Bag Bag methods and contracts.
To use, simply extend this class, and implement
the
AbstractTestBag.makeBag method.
If your bag fails one of these tests by design,
you may still use this base set of cases. |
AbstractTestSortedBag.java | Class | Abstract test class for
org.apache.commons.collections.SortedBag SortedBag methods and contracts. |
HashBag.java | Class | Implements Bag , using a HashMap to provide the
data storage. |
PredicatedBag.java | Class | Decorates another Bag to validate that additions
match a specified predicate. |
PredicatedSortedBag.java | Class | Decorates another SortedBag to validate that additions
match a specified predicate. |
SynchronizedBag.java | Class | Decorates another Bag to synchronize its behaviour
for a multi-threaded environment. |
SynchronizedSortedBag.java | Class | Decorates another SortedBag to synchronize its behaviour
for a multi-threaded environment. |
TestAll.java | Class | Entry point for tests. |
TestHashBag.java | Class | Extension of
TestBag for exercising the
HashBag implementation. |
TestPredicatedBag.java | Class | Extension of
TestBag for exercising the
PredicatedBag implementation. |
TestPredicatedSortedBag.java | Class | Extension of
TestBag for exercising the
PredicatedSortedBag implementation. |
TestTransformedBag.java | Class | Extension of
TestBag for exercising the
TransformedBag implementation. |
TestTransformedSortedBag.java | Class | Extension of
TestSortedBag for exercising the
TransformedSortedBag implementation. |
TestTreeBag.java | Class | Extension of
TestBag for exercising the
TreeBag implementation. |
TestTypedBag.java | Class | Extension of
TestBag for exercising the
TypedBag implementation. |
TestTypedSortedBag.java | Class | Extension of
TestBag for exercising the
TypedSortedBag implementation. |
TransformedBag.java | Class | Decorates another Bag to transform objects that are added. |
TransformedSortedBag.java | Class | Decorates another SortedBag to transform objects that are added. |
TreeBag.java | Class | Implements SortedBag , using a TreeMap to provide
the data storage. |
TypedBag.java | Class | Decorates another Bag to validate that elements added
are of a specific type.
The validation of additions is performed via an instanceof test against
a specified Class . |
TypedSortedBag.java | Class | Decorates another SortedBag to validate that elements added
are of a specific type.
The validation of additions is performed via an instanceof test against
a specified Class . |
UnmodifiableBag.java | Class | Decorates another Bag to ensure it can't be altered. |
UnmodifiableSortedBag.java | Class | Decorates another SortedBag to ensure it can't be altered. |