[concurrency-interest] ListIterator, ascending and descending iterator

Remi Forax forax at univ-mlv.fr
Fri Mar 25 09:15:07 EST 2005


Prior JSR166x, the only way to iterate in descending order on
a collection is to use a ListIterator on a List. All others data-structures
don't have this feature.

Now, JSR166x propose to introduce the interface NavigableSet
that provide "navigation" methods.

I think, to be coherent LinkedList/ArrayList could have a method 
descendingIterator(),
  this Iterator is more lightweight than the ListIterator.

I think LinkedHashSet could implements NavigableSet
(see bugs 4848853 and 6182958) to gain navigation ability.

what do you think about these ?

Rémi Forax



More information about the Concurrency-interest mailing list