|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jut.lang.AbstractOneTimeIterable<T> jut.lang.OneTimeIterableWrapper<T>
public class OneTimeIterableWrapper<T>
wrapper for an Iterable
to guarantee only one Iterator
can be obtained. as
convenience, a user method can be called before handing over the result of
Iterator.next()
, see AbstractOneTimeIterable.onNext(jut.lang.ParamRunnable)
.
this class is part of the problem solution that in the standard JDK the Iterable
s are
supposed to produce any number of Iterator
s. see also AbstractOneTimeIterable
.
Constructor Summary | |
---|---|
OneTimeIterableWrapper(Iterable<T> iterable)
wrap an Iterable so only one Iterator can be obtained. as convenience, a user
method can be called before handing over the result of Iterator.next() , see
AbstractOneTimeIterable.onNext(jut.lang.ParamRunnable) . |
Method Summary | |
---|---|
protected boolean |
iteratorHasNext()
returns true if the iterator has more elements. |
protected T |
iteratorNext()
returns the next element in the iterator. |
Methods inherited from class jut.lang.AbstractOneTimeIterable |
---|
iterator, onNext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OneTimeIterableWrapper(Iterable<T> iterable)
Iterable
so only one Iterator
can be obtained. as convenience, a user
method can be called before handing over the result of Iterator.next()
, see
AbstractOneTimeIterable.onNext(jut.lang.ParamRunnable)
.
iterable
- - the Iterable
to wrap.Method Detail |
---|
protected final boolean iteratorHasNext()
AbstractOneTimeIterable.iteratorNext()
would return an element rather than throwing an exception.)
iteratorHasNext
in class AbstractOneTimeIterable<T>
true
if the iterator has more elements, false
if not.protected final T iteratorNext()
iteratorNext
in class AbstractOneTimeIterable<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |