- All Superinterfaces:
- Iterator<T>
- All Known Implementing Classes:
- DCDStreamingCacheIterator, DCDStreamingInitialRoundIterator, SGDStreamingCacheIterator, SGDStreamingInitialRoundIterator, StreamingCacheIterator, StreamingInitialRoundIterator
public interface StreamingIterator<T extends ReasonerTerm>
extends Iterator<T>
Iterate over all the terms from grounding/cache.
Note that the order of events in these iterators is very precise.
This stems from needing the write some values every iteration.
We cannot prefetch terms too early, because this may flush the cache.
For example if we prefetch the next term in next(),
then the term we are about to return may be the last of its page.
This means that (pre)fetching the next term will flush the page.
So we will have written a stale value and
the retutned term will be converted into another one.
To avoid this, we will never prefetch (have two terms at a time)
and we will fetch in hasNext().