RFR: 8143850: Add indexed get() and set() methods to ArrayDeque
Archie Cobbs
acobbs at openjdk.org
Wed May 14 16:18:58 UTC 2025
On Mon, 12 May 2025 18:24:27 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> Because it is backed by an array, the `ArrayDeque` class has the ability to get and replace any element in the list (accessed by index) in constant time. However, this capability is not exposed in the API.
>
> Please review this PR which adds the following two new methods to `ArrayDeque`:
> * `public E get(int index)`
> * `public E set(int index, E element)`
Closing this PR for now while we decide what is the best approach.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25189#issuecomment-2880816417
More information about the core-libs-dev
mailing list