Re: EnumSet doesn't implement SequencedSet

2023-05-25 Thread David Alayachew
Hello folks, Since you are asking, let me chime in and say that I use enum's very frequently. However, my most common use case for them isn't for boolean flags -- it's actually the strategy pattern. Meaning, attaching a piece of logic to each value. And more importantly, I order the strategies via

Re: EnumSet doesn't implement SequencedSet

2023-05-23 Thread Aaron Scott-Boddendijk
> It doesn't seem like the members of an EnumSet would be iterated frequently... We use EnumSet and EnumMap extensively, frequently iterating over them (the enum's natural order being critical). > ...usually treated as a bag of named booleans used as a set of boolean options. So for us it's... "

Re: EnumSet doesn't implement SequencedSet

2023-05-23 Thread Stuart Marks
The idea of EnumSet implementing SortedSet or NavigableSet has been around for a long time; see https://bugs.openjdk.org/browse/JDK-6278287 But yes, EnumSet could also implement SequencedSet. Similarly, EnumMap could implement SequencedMap, SortedMap, or NavigableMap. Implementing NavigableS

Re: EnumSet doesn't implement SequencedSet

2023-05-23 Thread Tagir Valeev
Hello! Looks like this was overlooked. On the other hand, it could even implement SortedSet or Navigable set, as it's essentially not just ordered but sorted, according to the enum natural order. Same for EnumMap. With best regards, Tagir Valeev On Tue, May 23, 2023, 11:46 Andrey Turbanov wrote

EnumSet doesn't implement SequencedSet

2023-05-23 Thread Andrey Turbanov
Hello. I've noticed that EnumSet unfortunately doesn't implement the newly introduced interface SequencedSet. >From the first look it fits into it. Is there a reason for that? Sorry if it was already discussed. Andrey Turbanov