On Aug 5, 6:00 pm, Alexey <[email protected]> wrote:
> According to the docs, SortedSet expects to function based on either
> natural order (if the elements implement Comparable) or in accordance
> with whatever Comparator is provided. The only functional difference
> between the SortedSet contract and EnumSet API are all the methods in
> SortedSet dealing with subsets (first, subSet, etc.). Still doesn't
> seem to be any good reason why EnumSet doesn't implement SortedSet.
EnumSet is a specialized set intended to allow enums to replace
integer bitflags. Because of how this is implemented I don't think
there is an efficient way to implement the SortSet interface. So the
question is kind of should they have put in a poor-performing
implementation and made note of it in the JavaDocs(Followed shortly
thereafter with a FindBugs pattern saying not to use those methods.),
or just leave well enough alone and let people just use the existing
SortedSet implementations if they really need it?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---