sc > one feature that people have requested in iterators is the
sc > ability to reset them. So maybe IntIterator should have a
sc > reset() method that resets it to the start again.

rw > That makes the Iterator/<Primitive>Iterator adapters difficult to
rw > implement, but may be suitable for a sub-interface.  (I love
rw > reset-able iterators, by the way, cf.

sc> I think we should try to solve the difficulty problem
sc> and add reset() to IntIterator.

By "difficult", I think I mean "impossible".  There's no meaningful
implementation of reset() in the general IteratorToIntIteratorAdapter.  If
not every implementation of Iterator going to be resetable, why not have a
distinct ResetableIterator interface that advertises those that support
it.  The argument is the same as yours:

sc> I was thinking of adding a ResetableIterator interface to
sc> [collections] (Objects area) anyway, as a number of our
sc> interfaces implement reset() and it would be useful
sc> to be able to identify them.

whether or not we have the ability to change the Iterator interface.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to