org.apache.commons.collections |
This package contains the interfaces and utilities shared across all the subpackages of this component.
The following collection implementations are provided in the package:
- ArrayStack - a non synchronized Stack that follows the same API as java util Stack
- ExtendedProperties - extends the Properties class to add extra functionality
|
Java Source File Name | Type | Comment |
AbstractTestObject.java | Class | Abstract test class for
java.lang.Object methods and contracts.
To use, simply extend this class, and implement
the
AbstractTestObject.makeObject() method.
If your
Object fails one of these tests by design,
you may still use this base set of cases. |
ArrayStack.java | Class | An implementation of the
java.util.Stack API that is based on an
ArrayList instead of a Vector , so it is not
synchronized to protect against multi-threaded access. |
Bag.java | Interface | Defines a collection that counts the number of times an object appears in
the collection. |
BagUtils.java | Class | Provides utility methods and decorators for
Bag and
SortedBag instances. |
BeanMap.java | Class | An implementation of Map for JavaBeans which uses introspection to
get and put properties in the bean. |
BidiMap.java | Interface | Defines a map that allows bidirectional lookup between key and values.
This extended Map represents a mapping where a key may
lookup a value and a value may lookup a key with equal ease.
This interface extends Map and so may be used anywhere a map
is required. |
BinaryHeap.java | Class | Binary heap implementation of PriorityQueue .
The PriorityQueue interface has now been replaced for most uses
by the Buffer interface. |
BoundedCollection.java | Interface | Defines a collection that is bounded in size.
The size of the collection can vary, but it can never exceed a preset
maximum number of elements. |
BoundedFifoBuffer.java | Class | The BoundedFifoBuffer is a very efficient implementation of
Buffer that does not alter the size of the buffer at runtime.
The removal order of a BoundedFifoBuffer is based on the
insertion order; elements are removed in the same order in which they
were added. |
BoundedMap.java | Interface | Defines a map that is bounded in size.
The size of the map can vary, but it can never exceed a preset
maximum number of elements. |
Buffer.java | Interface | Defines a collection that allows objects to be removed in some well-defined order.
The removal order can be based on insertion order (eg, a FIFO queue or a
LIFO stack), on access order (eg, an LRU cache), on some arbitrary comparator
(eg, a priority queue) or on any other well-defined ordering.
Note that the removal order is not necessarily the same as the iteration
order. |
BufferOverflowException.java | Class | The BufferOverflowException is used when the buffer's capacity has been
exceeded. |
BufferUnderflowException.java | Class | The BufferUnderflowException is used when the buffer is already empty. |
BufferUtils.java | Class | Provides utility methods and decorators for
Buffer instances. |
BulkTest.java | Class | A
TestCase that can define both simple and bulk test methods.
A simple test method is the type of test traditionally
supplied by by
TestCase . |
Closure.java | Interface | Defines a functor interface implemented by classes that do something.
A Closure represents a block of code which is executed from
inside some block, function or iteration. |
ClosureUtils.java | Class | ClosureUtils provides reference implementations and utilities
for the Closure functor interface. |
CollectionUtils.java | Class | Provides utility methods and decorators for
Collection instances. |
ComparatorUtils.java | Class | Provides convenient static utility methods for Comparator
objects.
Most of the functionality in this class can also be found in the
comparators package. |
CursorableLinkedList.java | Class | A doubly-linked list implementation of the
List interface,
supporting a
ListIterator that allows concurrent modifications
to the underlying list. |
DefaultMapBag.java | Class | A skeletal implementation of the
Bag interface to minimize the effort required for target implementations.
Subclasses need only to call setMap(Map) in their constructor
(or invoke the Map constructor) specifying a map instance that will be used
to store the contents of the bag.
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 2.0 version: $Revision: 357494 $ $Date: 2005-12-18 19:05:31 +0000 (Sun, 18 Dec 2005) $ author: Chuck Burdick author: Michael A. |
DefaultMapEntry.java | Class | A default implementation of
java.util.Map.Entry since: Commons Collections 1.0 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: James Strachan author: Michael A. |
DoubleOrderedMap.java | Class | Red-Black tree-based implementation of Map. |
EnumerationUtils.java | Class | Provides utility methods for
Enumeration instances. |
ExtendedProperties.java | Class | This class extends normal Java properties by adding the possibility
to use the same key many times concatenating the value strings
instead of overwriting them.
Please consider using the PropertiesConfiguration class in
Commons-Configuration as soon as it is released.
The Extended Properties syntax is explained here:
-
Each property has the syntax
key = value
-
The key may use any character but the equal sign '='.
-
value may be separated on different lines if a backslash
is placed at the end of the line that continues below.
-
If value is a list of strings, each token is separated
by a comma ','.
-
Commas in each token are escaped placing a backslash right before
the comma.
-
Backslashes are escaped by using two consecutive backslashes i.e.
|
Factory.java | Interface | Defines a functor interface implemented by classes that create objects.
A Factory creates an object without using an input parameter.
If an input parameter is required, then
Transformer is more appropriate.
Standard implementations of common factories are provided by
FactoryUtils . |
FactoryUtils.java | Class | FactoryUtils provides reference implementations and utilities
for the Factory functor interface. |
FastArrayList.java | Class | A customized implementation of java.util.ArrayList designed
to operate in a multithreaded environment where the large majority of
method calls are read-only, instead of structural changes. |
FastHashMap.java | Class | A customized implementation of java.util.HashMap designed
to operate in a multithreaded environment where the large majority of
method calls are read-only, instead of structural changes. |
FastTreeMap.java | Class | A customized implementation of java.util.TreeMap designed
to operate in a multithreaded environment where the large majority of
method calls are read-only, instead of structural changes. |
FunctorException.java | Class | Runtime exception thrown from functors. |
HashBag.java | Class | A
Bag that is backed by a
HashMap . |
IterableMap.java | Interface | Defines a map that can be iterated directly without needing to create an entry set. |
IteratorUtils.java | Class | Provides static utility methods and decorators for
Iterator
instances. |
KeyValue.java | Interface | Defines a simple key value pair.
A Map Entry has considerable additional semantics over and above a simple
key-value pair. |
ListUtils.java | Class | Provides utility methods and decorators for
List instances. |
LocalTestNode.java | Class | |
LRUMap.java | Class |
An implementation of a Map which has a maximum size and uses a Least Recently Used
algorithm to remove items from the Map when the maximum size is reached and new items are added.
A synchronized version can be obtained with:
Collections.synchronizedMap( theMapToSynchronize )
If it will be accessed by multiple threads, you _must_ synchronize access
to this Map. |
MapIterator.java | Interface | Defines an iterator that operates over a Map .
This iterator is a special version designed for maps. |
MapPerformance.java | Class | TestMapPerformance is designed to perform basic Map performance tests. |
MapUtils.java | Class | Provides utility methods and decorators for
Map and
SortedMap instances. |
MultiHashMap.java | Class | MultiHashMap is the default implementation of the
org.apache.commons.collections.MultiMap MultiMap interface. |
MultiMap.java | Interface | Defines a map that holds a collection of values against each key. |
OrderedBidiMap.java | Interface | Defines a map that allows bidirectional lookup between key and values
and retains and provides access to an ordering. |
OrderedIterator.java | Interface | Defines an iterator that operates over an ordered collection. |
OrderedMap.java | Interface | Defines a map that maintains order and allows both forward and backward
iteration through that order. |
OrderedMapIterator.java | Interface | Defines an iterator that operates over an ordered Map . |
Predicate.java | Interface | Defines a functor interface implemented by classes that perform a predicate
test on an object.
A Predicate is the object equivalent of an if statement.
It uses the input object to return a true or false value, and is often used in
validation or filtering.
Standard implementations of common predicates are provided by
PredicateUtils . |
PredicateUtils.java | Class | PredicateUtils provides reference implementations and utilities
for the Predicate functor interface. |
PriorityQueue.java | Interface | Defines a collection for priority queues, which can insert, peek and pop. |
ProxyMap.java | Class | This Map wraps another Map
implementation, using the wrapped instance for its default
implementation. |
ReferenceMap.java | Class | Hash-based
Map implementation that allows
mappings to be removed by the garbage collector.
When you construct a ReferenceMap , you can
specify what kind of references are used to store the
map's keys and values. |
ResettableIterator.java | Interface | Defines an iterator that can be reset back to an initial state. |
ResettableListIterator.java | Interface | Defines a list iterator that can be reset back to an initial state. |
SequencedHashMap.java | Class | A map of objects whose mapping entries are sequenced based on the order in
which they were added. |
SetUtils.java | Class | Provides utility methods and decorators for
Set and
SortedSet instances. |
SortedBag.java | Interface | Defines a type of Bag that maintains a sorted order among
its unique representative members. |
SortedBidiMap.java | Interface | Defines a map that allows bidirectional lookup between key and values
and retains both keys and values in sorted order. |
StaticBucketMap.java | Class | A StaticBucketMap is an efficient, thread-safe implementation of
java.util.Map that performs well in in a highly
thread-contentious environment. |
SynchronizedPriorityQueue.java | Class | A thread safe version of the PriorityQueue. |
TestAll.java | Class | Entry point for all Collections package tests. |
TestAllPackages.java | Class | Entry point for all Collections project tests. |
TestArrayList.java | Class | Abstract test class for ArrayList. |
TestArrayStack.java | Class | Tests ArrayStack. |
TestBagUtils.java | Class | Tests for BagUtils factory methods. |
TestBeanMap.java | Class | |
TestBinaryHeap.java | Class | Tests the BinaryHeap.
version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: Michael A. |
TestBoundedFifoBuffer.java | Class | Test cases for BoundedFifoBuffer. |
TestBoundedFifoBuffer2.java | Class | Runs tests against a full BoundedFifoBuffer, since many of the algorithms
differ depending on whether the fifo is full or not. |
TestBufferUtils.java | Class | Tests for BufferUtils. |
TestClosureUtils.java | Class | Tests the org.apache.commons.collections.ClosureUtils class. |
TestCollectionUtils.java | Class | Tests for CollectionUtils. |
TestCursorableLinkedList.java | Class | Test class. |
TestDoubleOrderedMap.java | Class | Class TestDoubleOrderedMap
Test cases for DoubleOrderedMap. |
TestEnumerationUtils.java | Class | Tests EnumerationUtils. |
TestExtendedProperties.java | Class | Tests some basic functions of the ExtendedProperties class.
version: $Revision: 333060 $ $Date: 2005-11-13 16:59:51 +0000 (Sun, 13 Nov 2005) $ author: Geir Magnusson Jr. author: Mohan Kishore author: Stephen Colebourne author: Shinobu Kawai author: Henning P. |
TestFactoryUtils.java | Class | Tests the org.apache.commons.collections.FactoryUtils class. |
TestFastArrayList.java | Class | Test FastArrayList. |
TestFastArrayList1.java | Class | Test FastArrayList implementation in fast mode. |
TestFastHashMap.java | Class | Tests FastHashMap. |
TestFastHashMap1.java | Class | Test FastHashMap in fast mode. |
TestFastTreeMap.java | Class | Tests FastTreeMap. |
TestFastTreeMap1.java | Class | Test FastTreeMap in fast mode. |
TestHashBag.java | Class | Extension of
TestBag for exercising the
HashBag implementation. |
TestIteratorUtils.java | Class | Tests for IteratorUtils. |
TestLinkedList.java | Class | Tests base
java.util.LinkedList methods and contracts.
To use, simply extend this class, and implement
the
TestLinkedList.makeLinkedList method.
If your
LinkedList fails one of these tests by design,
you may still use this base set of cases. |
TestListUtils.java | Class | Tests for ListUtils. |
TestLRUMap.java | Class | Tests LRUMap. |
TestMapUtils.java | Class | Tests for MapUtils. |
TestMultiHashMap.java | Class | Unit Tests for MultiHashMap . |
TestPredicateUtils.java | Class | Tests the org.apache.commons.collections.PredicateUtils class. |
TestReferenceMap.java | Class | Tests for ReferenceMap. |
TestSequencedHashMap.java | Class | Unit tests
org.apache.commons.collections.SequencedHashMap .
Be sure to use the "labRat" instance whenever possible,
so that subclasses will be tested correctly.
version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: Morgan Delagrange author: Daniel Rall author: Henning P. |
TestSetUtils.java | Class | Tests for SetUtils. |
TestStaticBucketMap.java | Class | Unit tests.
org.apache.commons.collections.StaticBucketMap .
version: $Revision: 348273 $ $Date: 2005-11-22 22:24:25 +0000 (Tue, 22 Nov 2005) $ author: Michael A. |
TestTransformerUtils.java | Class | Tests the org.apache.commons.collections.TransformerUtils class. |
TestTreeBag.java | Class | Extension of
TestBag for exercising the
TreeBag implementation. |
TestTreeMap.java | Class | Tests TreeMap. |
TestTypedCollection.java | Class | Tests TypedCollection. |
TestUnboundedFifoBuffer.java | Class | Test cases for UnboundedFifoBuffer. |
Transformer.java | Interface | Defines a functor interface implemented by classes that transform one
object into another.
A Transformer converts the input object to the output object.
The input object should be left unchanged.
Transformers are typically used for type conversions, or extracting data
from an object.
Standard implementations of common transformers are provided by
TransformerUtils . |
TransformerUtils.java | Class | TransformerUtils provides reference implementations and
utilities for the Transformer functor interface. |
TreeBag.java | Class | A
Bag that is backed by a
TreeMap . |
UnboundedFifoBuffer.java | Class | UnboundedFifoBuffer is a very efficient buffer implementation.
According to performance testing, it exhibits a constant access time, but it
also outperforms ArrayList when used for the same purpose.
The removal order of an UnboundedFifoBuffer is based on the insertion
order; elements are removed in the same order in which they were added.
The iteration order is the same as the removal order.
The
UnboundedFifoBuffer.remove() and
UnboundedFifoBuffer.get() operations perform in constant time.
The
UnboundedFifoBuffer.add(Object) operation performs in amortized constant time. |
Unmodifiable.java | Interface | Marker interface for collections, maps and iterators that are unmodifiable.
This interface enables testing such as:
if (coll instanceof Unmodifiable) {
coll = new ArrayList(coll);
}
// now we know coll is modifiable
Of course all this only works if you use the Unmodifiable classes defined
in this library. |