commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject [collections] Resetable iterators
Date Sat, 08 Nov 2003 20:11:55 GMT
The ResetableIterator interface is causing hassles as I try to tidy the code
up ready for release. Out current design requires that there is a
ResetableIterator interface for each iterator type. And there are now 5
iterator types (normal, List, Map, Ordered, OrderedMap).

I would like to remove the Resetable*Iterator interfaces and replace with a
Resetable interface. The main impact is that an instanceof/cast check will
be required to check for resetability.

Iterator it = list.iterator();;
if (it instanceof Resetable) {
  ((Resetable) it).reset();

But this is not any different to how it would be anyway, as users would have
had to check for ResetableIterator.

Any objections to me making this change?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message