public class Iterators extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Collection<T> |
asCollection(Iterator<T> itr)
Returns an iterator as a collection.
|
static <T> List<T> |
asList(Iterator<T> itr)
Returns an iterator as a list.
|
static boolean |
equal(Iterator itr1,
Iterator itr2)
Tests two iterators for equality, meaning that they have the same
elements enumerated in the same order.
|
public static boolean equal(Iterator itr1, Iterator itr2)
itr1 - an Iterator.itr2 - an Iterator.true if the two iterators are not
null and equal, false otherwise.public static <T> List<T> asList(Iterator<T> itr)
itr - an Iterator.List.public static <T> Collection<T> asCollection(Iterator<T> itr)
itr - an Iterator.Collection.Copyright © 2012–2017 Emory University. All rights reserved.