Since I'm trying to get to an understanding from which I can write a PR with some new Javadocs for these type, let me try out the following:
Iter should never be used for a return type or parameter type in the public contract of a class. It is only to be used inside implementation code and it can be instantiated only to allow method-chaining as part of a calculation. ExtendedIterator should only be used as a return type or parameter type in the public contract of a class when that is specifically required by a type being implemented. Do those remarks capture facts about the two types? --- A. Soroka The University of Virginia Library On Jul 21, 2015, at 3:36 PM, Andy Seaborne <[email protected]> wrote: > On 21/07/15 15:38, A. Soroka wrote: >> A question came up for me, as a Jena newbie, in the course of JENA-966: >> "LazyIterator". >> >> The type ExtendedIterator in jena-core is used widely through jena-core. It >> features several convenient methods for use with iteration, like mapping >> through functions, filtering, and concatenation. >> >> The type Iter in jena-base is used widely through jena-base and jena-arq. It >> features many convenient methods for use with iteration, like everything >> ExtendedIterator does plus much more, (e.g. folding, selecting, reducing…). >> >> What is the difference in use for these two types? Why are they distinct? Is >> there some means by which it can be made clear when to use each and why? I >> would be happy to write a simple class Javadoc for Iter (which currently has >> none at all) to let folks know when to use it, if someone will explain that >> to me. >> >> --- >> A. Soroka >> The University of Virginia Library >> > > Iter is used in SDB and TDB as well where there are lots of iterators for all > sort so things. > > ExtendedIterator only works with ExtendedIterator. Not everything generates > ExtendedIterators. > > Iter is for working with java.util.Iterator; it is a different style where > the statics are more important than the class methods. It does allow > chaining but generally I don't think that style is very common in the code > base. > > Andy
