vigna / fastutil

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

`*ArraySet` classes should implement `SequencedSet` #335

Closed RacoonDog closed 2 weeks ago

RacoonDog commented 2 weeks ago

One of the new interfaces for collections introduced in java 21 is the SequencedSet interface which is used for Set implementations whose elements follow a defined order (For example, LinkedHashSet is a SequencedSet).

Considering *ArraySet classes also have strictly defined ordering of their elements due to being array backed, they should implement SequencedSet in java 21 and above.

vigna commented 2 weeks ago

Yep but we're still at Java 9. NavigableSet world be a better candidate. Also, ArrayMap does not guarantee any iteration order (try to delete an element).