org.apache.commons.collections.iterators |
This package contains implementations of the
{@link java.util.Iterator Iterator} interface.
You may also consider using
{@link org.apache.commons.collections.IteratorUtils IteratorUtils},
which is a single class that uses static methods to construct instances
of the classes in this package.
|
Java Source File Name | Type | Comment |
AbstractEmptyIterator.java | Class | Provides an implementation of an empty iterator. |
AbstractIteratorDecorator.java | Class | Provides basic behaviour for decorating an iterator with extra functionality. |
AbstractListIteratorDecorator.java | Class | Provides basic behaviour for decorating a list iterator with extra functionality. |
AbstractMapIteratorDecorator.java | Class | Provides basic behaviour for decorating a map iterator with extra functionality. |
AbstractOrderedMapIteratorDecorator.java | Class | Provides basic behaviour for decorating an ordered map iterator with extra functionality. |
AbstractTestIterator.java | Class | Abstract class for testing the Iterator interface. |
AbstractTestListIterator.java | Class | Abstract class for testing the ListIterator interface. |
AbstractTestMapIterator.java | Class | Abstract class for testing the MapIterator interface. |
AbstractTestOrderedMapIterator.java | Class | Abstract class for testing the OrderedMapIterator interface. |
ArrayIterator.java | Class | Implements an
java.util.Iterator Iterator over any array.
The array can be either an array of object or of primitives. |
ArrayListIterator.java | Class | Implements a
ListIterator over an array. |
CollatingIterator.java | Class | Provides an ordered iteration over the elements contained in
a collection of ordered Iterators. |
EmptyIterator.java | Class | Provides an implementation of an empty iterator. |
EmptyListIterator.java | Class | Provides an implementation of an empty list iterator. |
EmptyMapIterator.java | Class | Provides an implementation of an empty map iterator. |
EmptyOrderedIterator.java | Class | Provides an implementation of an empty ordered iterator. |
EmptyOrderedMapIterator.java | Class | Provides an implementation of an empty ordered map iterator. |
EntrySetMapIterator.java | Class | Implements a MapIterator using a Map entrySet. |
EnumerationIterator.java | Class | Adapter to make
Enumeration Enumeration instances appear
to be
Iterator Iterator instances. |
FilterIterator.java | Class | Decorates another
Iterator using a predicate to filter elements. |
FilterListIterator.java | Class | Decorates another
ListIterator using a predicate to filter elements. |
IteratorChain.java | Class | An IteratorChain is an Iterator that wraps a number of Iterators.
This class makes multiple iterators look like one to the caller
When any method from the Iterator interface is called, the IteratorChain
will delegate to a single underlying Iterator. |
IteratorEnumeration.java | Class | Adapter to make an
Iterator Iterator instance appear to be
an
Enumeration Enumeration instance. |
ListIteratorWrapper.java | Class | Converts an iterator into a list iterator by caching the returned entries.
The ListIterator interface has additional useful methods
for navigation - previous() and the index methods.
This class allows a regular Iterator to behave as a
ListIterator . |
LoopingIterator.java | Class | An Iterator that restarts when it reaches the end.
The iterator will loop continuously around the provided elements, unless
there are no elements in the collection to begin with, or all the elements
have been
LoopingIterator.remove removed .
Concurrent modifications are not directly supported, and for most collection
implementations will throw a ConcurrentModificationException. |
LoopingListIterator.java | Class | A ListIterator that restarts when it reaches the end or when it
reaches the beginning. |
ObjectArrayIterator.java | Class | An
Iterator over an array of objects.
This iterator does not support
ObjectArrayIterator.remove , as the object array cannot be
structurally modified.
The iterator implements a
ObjectArrayIterator.reset method, allowing the reset of the iterator
back to the start if required.
since: Commons Collections 3.0 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: James Strachan author: Mauricio S. |
ObjectArrayListIterator.java | Class | Implements a
ListIterator over an array of objects.
This iterator does not support
ObjectArrayListIterator.add or
ObjectArrayListIterator.remove , as the object array
cannot be structurally modified. |
ObjectGraphIterator.java | Class | An Iterator that can traverse multiple iterators down an object graph.
This iterator can extract multiple objects from a complex tree-like object graph.
The iteration starts from a single root object.
It uses a Transformer to extract the iterators and elements.
Its main benefit is that no intermediate List is created.
For example, consider an object graph:
|- Branch -- Leaf
| \- Leaf
|- Tree | /- Leaf
| |- Branch -- Leaf
Forest | \- Leaf
| |- Branch -- Leaf
| | \- Leaf
|- Tree | /- Leaf
|- Branch -- Leaf
|- Branch -- Leaf
The following Transformer , used in this class, will extract all
the Leaf objects without creating a combined intermediate list:
public Object transform(Object input) {
if (input instanceof Forest) {
return ((Forest) input).treeIterator();
}
if (input instanceof Tree) {
return ((Tree) input).branchIterator();
}
if (input instanceof Branch) {
return ((Branch) input).leafIterator();
}
if (input instanceof Leaf) {
return input;
}
throw new ClassCastException();
}
Internally, iteration starts from the root object. |
ProxyIterator.java | Class | A Proxy
Iterator Iterator which delegates its methods to a proxy instance. |
ProxyListIterator.java | Class | A proxy
ListIterator ListIterator which delegates its
methods to a proxy instance. |
ReverseListIterator.java | Class | Iterates backwards through a List, starting with the last element
and continuing to the first. |
SingletonIterator.java | Class | SingletonIterator is an
Iterator over a single
object instance. |
SingletonListIterator.java | Class | SingletonIterator is an
ListIterator over a single
object instance. |
TestAll.java | Class | Entry point for all iterator tests. |
TestArrayIterator.java | Class | Tests the ArrayIterator to ensure that the next() method will actually
perform the iteration rather than the hasNext() method.
The code of this test was supplied by Mauricio S. |
TestArrayIterator2.java | Class | Tests the ArrayIterator with primitive type arrays. |
TestArrayListIterator.java | Class | Test the ArrayListIterator class. |
TestArrayListIterator2.java | Class | Test the ArrayListIterator class with primitives. |
TestCollatingIterator.java | Class | Unit test suite for
CollatingIterator . |
TestFilterIterator.java | Class | Test the filter iterator. |
TestFilterListIterator.java | Class | Tests the FilterListIterator class. |
TestIteratorChain.java | Class | Tests the IteratorChain class.
version: $Revision: 171347 $ $Date: 2005-05-22 18:27:34 +0100 (Sun, 22 May 2005) $ author: James Strachan author: Mauricio S. |
TestListIteratorWrapper.java | Class | Tests the ListIteratorWrapper to insure that it simulates
a ListIterator correctly. |
TestLoopingIterator.java | Class | Tests the LoopingIterator class. |
TestLoopingListIterator.java | Class | Tests the LoopingListIterator class. |
TestObjectArrayIterator.java | Class | Tests the ObjectArrayIterator.
version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: James Strachan author: Mauricio S. |
TestObjectArrayListIterator.java | Class | Tests the ObjectArrayListIterator class. |
TestObjectArrayListIterator2.java | Class | Tests the ObjectArrayListIterator class. |
TestObjectGraphIterator.java | Class | Testcase. |
TestReverseListIterator.java | Class | Tests the ReverseListIterator. |
TestSingletonIterator.java | Class | Tests the SingletonIterator to ensure that the next() method will actually
perform the iteration rather than the hasNext() method. |
TestSingletonIterator2.java | Class | Tests the SingletonIterator to ensure that the next() method will actually
perform the iteration rather than the hasNext() method. |
TestSingletonListIterator.java | Class | Tests the SingletonListIterator. |
TestUniqueFilterIterator.java | Class | Tests the UniqueFilterIterator class.
version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: James Strachan author: Mauricio S. |
TestUnmodifiableIterator.java | Class | Tests the UnmodifiableIterator. |
TestUnmodifiableListIterator.java | Class | Tests the UnmodifiableListIterator. |
TestUnmodifiableMapIterator.java | Class | Tests the UnmodifiableMapIterator. |
TestUnmodifiableOrderedMapIterator.java | Class | Tests the UnmodifiableOrderedMapIterator. |
TransformIterator.java | Class | Decorates an iterator such that each element returned is transformed. |
UniqueFilterIterator.java | Class | A FilterIterator which only returns "unique" Objects. |
UnmodifiableIterator.java | Class | Decorates an iterator such that it cannot be modified. |
UnmodifiableListIterator.java | Class | Decorates a list iterator such that it cannot be modified. |
UnmodifiableMapIterator.java | Class | Decorates a map iterator such that it cannot be modified. |
UnmodifiableOrderedMapIterator.java | Class | Decorates an ordered map iterator such that it cannot be modified. |