RFR: 8266571: Sequenced Collections [v12]

Hollis Waite duke at openjdk.org
Fri Jul 21 17:19:25 UTC 2023


On Fri, 21 Jul 2023 16:48:12 GMT, Stuart Marks <smarks at openjdk.org> wrote:

> ListIterator fuses three different concepts: the ability to traverse forwards and
> backwards, the ability to mutate the underlying List at the current location
> (add/remove/set), and the index of the current location. Which of these is important
> to your use case? What operations would be helpful?

My specific use case requires bidirectional iteration of a LinkedHashMap along with ability to remove items. It wouldn't need to be a ListIterator specifically, but once one has a collection with both a size and bidirectional iterator, it's trivial to turn it into a List via an AbstractSequentialList adapter. If this has already been looked into, by all means leave as is. I thought maybe it was an unexplored oversight.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/7387#issuecomment-1646013953


More information about the core-libs-dev mailing list