Package com.mchange.v1.util
Class IteratorUtils
java.lang.Object
com.mchange.v1.util.IteratorUtils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equivalent
(Iterator ii, Iterator jj) static void
static void
Fills an array with the contents of an iterator.static Iterator
static Object[]
static Object[]
static Object[]
Designed to help implement Collection.toArray(Object[] )methods...static ArrayList
toArrayList
(Iterator ii, int initial_capacity)
-
Field Details
-
EMPTY_ITERATOR
-
-
Method Details
-
oneElementUnmodifiableIterator
-
equivalent
-
toArrayList
-
fillArray
Fills an array with the contents of an iterator. If the array is too small, it will contain the first portion of the iterator. If the array can contain more elements than the iterator, extra elements are left untouched, unless null_terminate is set to true, in which case the element immediately following the last from the iterator is set to null. (This method is intended to make it easy to implement Collection.toArray(Object[] oo) methods...- Parameters:
null_terminate
- iff there is extra space in the array, set the element immediately after the last from the iterator to null.
-
fillArray
-
toArray
public static Object[] toArray(Iterator ii, int array_size, Class componentClass, boolean null_terminate) - Parameters:
null_terminate
- iff there is extra space in the array, set the element immediately after the last from the iterator to null.
-
toArray
-
toArray
Designed to help implement Collection.toArray(Object[] )methods... does the right thing if you can express an iterator and know the size of your Collection.
-