- All Superinterfaces:
- java.util.Iterator<Topic>
- All Known Implementing Classes:
- LayerStack.TopicsIterator
public interface TopicIterator
extends java.util.Iterator<Topic>
An iterator with a mechanism to dispose of it cleanly. When iterating
topics, some implementations need to dispose of the iterator properly.
Previously this was done when the iterator had been completely iterated
through. But in some cases it may be desirable to stop iterating earlier and
going through the whole thing could be time consuming. This class is designed
to address this issue. Whenever a topic map implementation returns a TopicIterator,
its dispose method may be called to stop the iteration process early. If a
normal Iterator is returned, then it should be assumed that it must be iterated
completely or things might not be cleaned up properly.
- Author:
- olli