scala/scala — pull request #3716 by tvierling (2014-05-06 14:21:42+00:00)
Title: SI-5547: Add efficient access to java.util.Enum{Map,Set}.

This uses JavaConversions wrappers, which will then be cleanly
convertible back to their Java equivalents.

I had this in my old Scala utility library for ages, and it seems I was not the only one who wanted this functionality. Rather than implementing pure-Scala collections for enums, reusing the Java versions is best, as they are already designed to be optimized for the Java enum type structure. The scaladoc includes examples exploiting each method, and the methods are organized to make "EnumSet" and "EnumMap" appear to act like integral collection types even though they aren't. The results of each object method are explicitly typed as scala.collection.mutable.{Set,Map}.