vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.74k stars 194 forks source link

Support for getLast/getFirst in lists #319

Closed Nightenom closed 2 months ago

Nightenom commented 2 months ago

Hi, in Java 21 new collection interface SequencedCollection was added => few methods were added to List interface - for manipulation with first/last element + reverse method. These methods have no companion for primitive-typed fastutil lists

vigna commented 2 months ago

Unfortunately that's not gonna happen. We are moving everything to Rust and fastutil is in maintenance mode.

Nightenom commented 2 months ago

Hmm, i can try PRing it myself during summer, also kinda surprised by your statement given wide public usage of this library

vigna commented 2 months ago

Well, but what do you have in mind? fastutil is on Java 9, you cannot use interfaces from Java 21. I mean, NavigableSet/Map would come first.

Nightenom commented 2 months ago

I mean, compared to NavigableMap/Set, the Sequence ifaces add singleliner defaulted methods (except #reversed()), which are just syntax sugar ie. they do not provided any new functionality. So I think the library may easily provide primitive typed counterparts without even using the jdk ifaces as a starting point. (also multi-versioned jar exists, but it might be an overkill since one must already hard type via library ifaces to use the performance gain) However the #reversed() method will be a larger problem. But I think I can PR the rest during summer if you want