|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object util.Functional.Iteration<T>
T
- The type of object over which to iterate.public static final class Functional.Iteration<T>
An adaptor for iterating in a foreach loop, given an iterator.
(Really, Iterator<T> should be a superinterface of Iterable<T>, or at least iterators ought to be allowed in foreach loops (since the meaning is obvious). Oh well.)
Field Summary | |
---|---|
Iterator<T> |
iter
The iterator iterated over. |
Constructor Summary | |
---|---|
Functional.Iteration(Iterator<T> iter)
Construct an Iterable for an Iterator. |
Method Summary | ||
---|---|---|
Iterator<T> |
iterator()
Get back the iterator passed in to the constructor. |
|
static
|
with(Iterator<T> iter)
Convenience constructor (to avoid giving an explicit type). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Iterator<T> iter
Constructor Detail |
---|
public Functional.Iteration(Iterator<T> iter)
iter
- The Iterator to iterate over.Method Detail |
---|
public Iterator<T> iterator()
iterator
in interface Iterable<T>
Iterable.iterator()
public static <T> Functional.Iteration<T> with(Iterator<T> iter)
T
- The type of object over which to iterate.iter
- The iterator to iterate over.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |