java.lang.Object | +--org.apache.commons.collections.IteratorUtils
static ResettableIterator | An iterator over no elements |
static ResettableListIterator | A list iterator over no elements |
static MapIterator | A map iterator over no elements |
static OrderedIterator | An ordered iterator over no elements |
static OrderedMapIterator | An ordered map iterator over no elements |
IteratorUtils is not normally instantiated. |
static ResettableIterator | arrayIterator(Object[] array) Gets an iterator over an object array. |
static ResettableIterator | arrayIterator(Object array) Gets an iterator over an object or primitive array. |
static ResettableIterator | arrayIterator(Object[] array, int start) Gets an iterator over the end part of an object array. |
static ResettableIterator | arrayIterator(Object array, int start) Gets an iterator over the end part of an object or primitive array. |
static ResettableIterator | arrayIterator(Object[] array, int start, int end) Gets an iterator over part of an object array. |
static ResettableIterator | arrayIterator(Object array, int start, int end) Gets an iterator over part of an object or primitive array. |
static ResettableListIterator | arrayListIterator(Object[] array) Gets a list iterator over an object array. |
static ResettableListIterator | arrayListIterator(Object array) Gets a list iterator over an object or primitive array. |
static ResettableListIterator | arrayListIterator(Object[] array, int start) Gets a list iterator over the end part of an object array. |
static ResettableListIterator | arrayListIterator(Object array, int start) Gets a list iterator over the end part of an object or primitive array. |
static ResettableListIterator | arrayListIterator(Object[] array, int start, int end) Gets a list iterator over part of an object array. |
static ResettableListIterator | arrayListIterator(Object array, int start, int end) Gets a list iterator over part of an object or primitive array. |
static Enumeration | asEnumeration(Iterator iterator) Gets an enumeration that wraps an iterator. |
static Iterator | asIterator(Enumeration enumeration) Gets an iterator that provides an iterator view of the given enumeration. |
static Iterator | asIterator(Enumeration enumeration, Collection removeCollection) Gets an iterator that provides an iterator view of the given enumeration that will remove elements from the specified collection. |
static Iterator | chainedIterator(Iterator iterator1, Iterator iterator2) Gets an iterator that iterates through two Iterators one after another. |
static Iterator | chainedIterator(Iterator[] iterators) Gets an iterator that iterates through an array of Iterators one after another. |
static Iterator | chainedIterator(Collection iterators) Gets an iterator that iterates through a collections of Iterators one after another. |
static Iterator | collatedIterator(Comparator comparator, Iterator iterator1, Iterator iterator2) Gets an iterator that provides an ordered iteration over the elements contained in a collection of ordered Iterators. |
static Iterator | collatedIterator(Comparator comparator, Iterator[] iterators) Gets an iterator that provides an ordered iteration over the elements contained in an array of Iterators. |
static Iterator | collatedIterator(Comparator comparator, Collection iterators) Gets an iterator that provides an ordered iteration over the elements contained in a collection of Iterators. |
static ResettableIterator | Gets an empty iterator. |
static ResettableListIterator | Gets an empty list iterator. |
static MapIterator | Gets an empty map iterator. |
static OrderedIterator | Gets an empty ordered iterator. |
static OrderedMapIterator | Gets an empty ordered map iterator. |
static Iterator | filteredIterator(Iterator iterator, Predicate predicate) Gets an iterator that filters another iterator. |
static ListIterator | filteredListIterator(ListIterator listIterator, Predicate predicate) Gets a list iterator that filters another list iterator. |
static Iterator | getIterator(Object obj) Gets a suitable Iterator for the given object. |
static ResettableIterator | loopingIterator(Collection coll) Gets an iterator that loops continuously over the supplied collection. |
static ResettableIterator | singletonIterator(Object object) Gets a singleton iterator. |
static ListIterator | singletonListIterator(Object object) Gets a singleton list iterator. |
static Object[] | toArray(Iterator iterator) Gets an array based on an iterator. |
static Object[] | toArray(Iterator iterator, Class arrayClass) Gets an array based on an iterator. |
static List | toList(Iterator iterator) Gets a list based on an iterator. |
static List | toList(Iterator iterator, int estimatedSize) Gets a list based on an iterator. |
static ListIterator | toListIterator(Iterator iterator) Gets a list iterator based on a simple iterator. |
static Iterator | transformedIterator(Iterator iterator, Transformer transform) Gets an iterator that transforms the elements of another iterator. |
static Iterator | unmodifiableIterator(Iterator iterator) Gets an immutable version of an Iterator. |
static ListIterator | unmodifiableListIterator(ListIterator listIterator) Gets an immutable version of a ListIterator. |
static MapIterator | unmodifiableMapIterator(MapIterator mapIterator) Gets an immutable version of a MapIterator. |
public static final ResettableIterator EMPTY_ITERATOR
public static final ResettableListIterator EMPTY_LIST_ITERATOR
public static final MapIterator EMPTY_MAP_ITERATOR
public static final OrderedIterator EMPTY_ORDERED_ITERATOR
public static final OrderedMapIterator EMPTY_ORDERED_MAP_ITERATOR
public IteratorUtils()
public static ResettableIterator arrayIterator(Object array, int start, int end)
- if the array is not an array
- if array bounds are invalid
- if end is before start
- if array is nullpublic static ResettableIterator arrayIterator(Object array, int start)
- if the array is not an array
- if start is less than zero or greater
than the length of the array
- if array is nullpublic static ResettableIterator arrayIterator(Object array)
- if the array is not an array
- if array is nullpublic static ResettableIterator arrayIterator(Object[] array, int start, int end)
- if array bounds are invalid
- if end is before start
- if array is nullpublic static ResettableIterator arrayIterator(Object[] array, int start)
- if start is less than zero or greater
than the length of the array
- if array is nullpublic static ResettableIterator arrayIterator(Object[] array)
- if array is nullpublic static ResettableListIterator arrayListIterator(Object array, int start, int end)
- if the array is not an array
- if array bounds are invalid
- if end is before start
- if array is nullpublic static ResettableListIterator arrayListIterator(Object array, int start)
- if the array is not an array
- if start is less than zero
- if array is nullpublic static ResettableListIterator arrayListIterator(Object array)
- if the array is not an array
- if array is nullpublic static ResettableListIterator arrayListIterator(Object[] array, int start, int end)
- if array bounds are invalid
- if end is before start
- if array is nullpublic static ResettableListIterator arrayListIterator(Object[] array, int start)
- if start is less than zero
- if array is nullpublic static ResettableListIterator arrayListIterator(Object[] array)
- if array is nullpublic static Enumeration asEnumeration(Iterator iterator)
- if iterator is nullpublic static Iterator asIterator(Enumeration enumeration, Collection removeCollection)
public static Iterator asIterator(Enumeration enumeration)
public static Iterator chainedIterator(Collection iterators)
- if iterators collection is null or contains a null
- if the iterators collection contains the wrong object typepublic static Iterator chainedIterator(Iterator iterator1, Iterator iterator2)
- if either iterator is nullpublic static Iterator chainedIterator(Iterator[] iterators)
- if iterators array is null or contains a nullpublic static Iterator collatedIterator(Comparator comparator, Collection iterators)
A
and B
,
the Iterator.next() method will return the lesser of
A.next()
and B.next()
and so on.
The comparator is optional. If null is specified then natural order is used.
- if iterators collection is null or contains a null
- if the iterators collection contains the wrong object typepublic static Iterator collatedIterator(Comparator comparator, Iterator iterator1, Iterator iterator2)
A
and B
,
the Iterator.next() method will return the lesser of
A.next()
and B.next()
.
The comparator is optional. If null is specified then natural order is used.
- if either iterator is nullpublic static Iterator collatedIterator(Comparator comparator, Iterator[] iterators)
A
and B
,
the Iterator.next() method will return the lesser of
A.next()
and B.next()
and so on.
The comparator is optional. If null is specified then natural order is used.
- if iterators array is null or contains a nullpublic static ResettableIterator emptyIterator()
public static ResettableListIterator emptyListIterator()
public static MapIterator emptyMapIterator()
public static OrderedIterator emptyOrderedIterator()
public static OrderedMapIterator emptyOrderedMapIterator()
public static Iterator filteredIterator(Iterator iterator, Predicate predicate)
- if either parameter is nullpublic static ListIterator filteredListIterator(ListIterator listIterator, Predicate predicate)
- if either parameter is nullpublic static Iterator getIterator(Object obj)
public static ResettableIterator loopingIterator(Collection coll)
- if the collection is nullpublic static ResettableIterator singletonIterator(Object object)
public static ListIterator singletonListIterator(Object object)
public static Object[] toArray(Iterator iterator, Class arrayClass)
- if iterator parameter is null
- if arrayClass is null
- if the arrayClass is invalidpublic static Object[] toArray(Iterator iterator)
- if iterator parameter is nullpublic static List toList(Iterator iterator, int estimatedSize)
- if iterator parameter is null
- if the size is less than 1public static List toList(Iterator iterator)
- if iterator parameter is nullpublic static ListIterator toListIterator(Iterator iterator)
- if iterator parameter is nullpublic static Iterator transformedIterator(Iterator iterator, Transformer transform)
- if either parameter is nullpublic static Iterator unmodifiableIterator(Iterator iterator)
public static ListIterator unmodifiableListIterator(ListIterator listIterator)
public static MapIterator unmodifiableMapIterator(MapIterator mapIterator)