org.apache.commons.collections.list |
This package contains implementations of the
{@link java.util.List List} interface.
The following implementations are provided in the package:
- TreeList - a list that is optimised for insertions and removals at any index in the list
- CursorableLinkedList - a list that can be modified while the listIterator (cursor) is being used
- NodeCachingLinkedList - a linked list that caches the storage nodes for a performance gain
The following decorators are provided in the package:
- Synchronized - synchronizes method access for multi-threaded environments
- Unmodifiable - ensures the collection 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
- FixedSize - ensures that the size of the list cannot change
- Lazy - creates objects in the list on demand
- Growth - grows the list instead of erroring when set/add used with index beyond the list size
- SetUnique - a list that avoids duplicate entries like a Set
|
Java Source File Name | Type | Comment |
AbstractLinkedList.java | Class | An abstract implementation of a linked list which provides numerous points for
subclasses to override.
Overridable methods are provided to change the storage node and to change how
nodes are added to and removed. |
AbstractListDecorator.java | Class | Decorates another List to provide additional behaviour. |
AbstractSerializableListDecorator.java | Class | Serializable subclass of AbstractListDecorator. |
AbstractTestList.java | Class | Abstract test class for
java.util.List methods and contracts.
To use, simply extend this class, and implement
the
AbstractTestList.makeEmptyList method.
If your
List fails one of these tests by design,
you may still use this base set of cases. |
CursorableLinkedList.java | Class | A List implementation with a ListIterator that
allows concurrent modifications to the underlying list.
This implementation supports all of the optional
List operations.
It extends AbstractLinkedList and thus provides the
stack/queue/dequeue operations available in
java.util.LinkedList .
The main feature of this class is the ability to modify the list and the
iterator at the same time. |
FixedSizeList.java | Class | Decorates another List to fix the size preventing add/remove. |
GrowthList.java | Class | Decorates another List to make it seamlessly grow when
indices larger than the list size are used on add and set,
avoiding most IndexOutOfBoundsExceptions.
This class avoids errors by growing when a set or add method would
normally throw an IndexOutOfBoundsException.
Note that IndexOutOfBoundsException IS returned for invalid negative indices.
Trying to set or add to an index larger than the size will cause the list
to grow (using null elements). |
LazyList.java | Class | Decorates another List to create objects in the list on demand.
When the
LazyList.get(int) method is called with an index greater than
the size of the list, the list will automatically grow in size and return
a new object from the specified factory. |
NodeCachingLinkedList.java | Class | A List implementation that stores a cache of internal Node objects
in an effort to reduce wasteful object creation.
A linked list creates one Node for each item of data added. |
PredicatedList.java | Class | Decorates another List to validate that all additions
match a specified predicate. |
SetUniqueList.java | Class | Decorates a List to ensure that no duplicates are present
much like a Set . |
SynchronizedList.java | Class | Decorates another List to synchronize its behaviour
for a multi-threaded environment. |
TestAbstractLinkedList.java | Class | Test case for
AbstractLinkedList . |
TestAll.java | Class | Entry point for tests. |
TestCursorableLinkedList.java | Class | Test class. |
TestFixedSizeList.java | Class | Extension of
TestList for exercising the
FixedSizeList implementation. |
TestGrowthList.java | Class | Extension of
TestList for exercising the
GrowthList . |
TestNodeCachingLinkedList.java | Class | Test class for NodeCachingLinkedList, a performance optimised LinkedList. |
TestPredicatedList.java | Class | Extension of
TestList for exercising the
PredicatedList implementation. |
TestSetUniqueList.java | Class | JUnit tests. |
TestSynchronizedList.java | Class | Extension of
TestList for exercising the
SynchronizedList implementation. |
TestTransformedList.java | Class | Extension of
TestList for exercising the
TransformedList implementation. |
TestTreeList.java | Class | |
TestTypedList.java | Class | Extension of
TestList for exercising the
TypedList implementation. |
TestUnmodifiableList.java | Class | Extension of
AbstractTestList for exercising the
UnmodifiableList implementation. |
TransformedList.java | Class | Decorates another List to transform objects that are added. |
TreeList.java | Class | A List implementation that is optimised for fast insertions and
removals at any index in the list.
This list implementation utilises a tree structure internally to ensure that
all insertions and removals are O(log n). |
TypedList.java | Class | Decorates another List to validate that elements
added are of a specific type.
The validation of additions is performed via an instanceof test against
a specified Class . |
UnmodifiableList.java | Class | Decorates another List to ensure it can't be altered. |