org.entityfs.util.itr
Class Iterators
java.lang.Object
org.entityfs.util.itr.Iterators
public final class Iterators
- extends Object
This is a utility class with static methods for working with Iterator
:s.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- In_jar:
- entityfs-util
|
Method Summary |
static
|
list(Iterator<T> itr)
This iterates through the provided Iterator and returns a List with the returned elements in the order that they were returned in. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
list
public static <T> List<T> list(Iterator<T> itr)
- This iterates through the provided
Iterator and returns a List with the returned elements in the order that they were returned in.
This corresponds to Java's Collections.list method, only that it
takes an Iterator argument instead of an Enumeration
(making it infinitely more useful for EntityFS purposes).
- Type Parameters:
T - The type of elements returned by the iterator.- Parameters:
itr - The iterator.
- Returns:
- A list with all elements returned from the iterator, in the order
that they were returned.