IterableType
- the object type that is the subject of iteration.public interface IWiktionaryIterator<IterableType> extends Iterable<IterableType>, Iterator<IterableType>
IWiktionaryPage
, IWiktionaryEntry
,
IWiktionarySense
). The iterator supports both the usage as
Iterator
and as Iterable
.
Caveat: the latter provides always the same instance, so use the
WiktionaryIterator as an Iterable
only once or fetch another
WiktionaryIterator for other uses. This should save some memory and
allow convenient usage in numerous situations. Besides, the implementation
also allows to react on stopping the iteration, which is the case if
(a) all items have been traversed, or (b) the user manually stops the
iteration by invoking the close()
method. Implementing the
corresponding hotspot offers the possibility of closing a connection
or freeing a resource after iteration. The iterator is read-only.
Modifier and Type | Method and Description |
---|---|
void |
close()
Stops the iteration.
|
boolean |
isClosed()
Returns true if the iterator has been closed, which is the case
after
close() has been called or after the last element
has been retrieved using the Iterator.next() method. |
forEach, iterator, spliterator
forEachRemaining, hasNext, next, remove
void close()
Iterator.hasNext()
will always result in false
.boolean isClosed()
close()
has been called or after the last element
has been retrieved using the Iterator.next()
method.Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.