|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.collections.iterators.Iterators
public class Iterators
This class consists exclusively of static methods that operate on or return iterators. It is the Iterator-equivalent of java.util.Collections.
| Constructor Summary | |
|---|---|
Iterators()
|
|
| Method Summary | ||
|---|---|---|
static
|
addAll(Iterator<? extends E> iter,
C collection)
Adds all elements from the supplied iterator to the specified collection. |
|
static
|
asList(Iterator<? extends E> iter)
Get a List containing all elements obtained from the specified iterator. |
|
static void |
closeCloseable(Iterator<?> iter)
Closes the supplied iterator if it is an instance of CloseableIterator, otherwise the request is ignored. |
|
static String |
toString(Iterator<?> iter,
String separator)
Converts an iterator to a string by concatenating all of the string representations of objects in the iterator, divided by a separator. |
|
static void |
toString(Iterator<?> iter,
String separator,
StringBuilder sb)
Converts an iterator to a string by concatenating all of the string representations of objects in the iterator, divided by a separator. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Iterators()
| Method Detail |
|---|
public static <E> List<E> asList(Iterator<? extends E> iter)
iter - the iterator to get the elements from
public static <E,C extends Collection<E>> C addAll(Iterator<? extends E> iter,
C collection)
CloseableIterator it is automatically
closed after consumption.
iter - An iterator containing elements to add to the container. If the iterator
is an instance of CloseableIterator it is automatically closed
after consumption.collection - The collection to add the elements to.
public static void closeCloseable(Iterator<?> iter)
CloseableIterator, otherwise the request is ignored.
iter - The iterator that should be closed.
public static String toString(Iterator<?> iter,
String separator)
iter - An iterator over arbitrary objects that are expected to implement
Object.toString().separator - The separator to insert between the object strings.
public static void toString(Iterator<?> iter,
String separator,
StringBuilder sb)
iter - An iterator over arbitrary objects that are expected to implement
Object.toString().separator - The separator to insert between the object strings.sb - A StringBuilder to append the iterator string to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||