Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6278287

(coll) EnumSet should implement NavigableSet, EnumMap should implement NavigableMap

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE REQUEST :
      EnumSet implements Set. We can't take full advantage of the order in an enum unless EnumSet implements SortedSet.

      JUSTIFICATION :
      enums have a defined order. EnumSet should take advantage of this to implement SortedSet efficiently.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I'd like to see EnumSet provide all the API for SortedSet.
      ACTUAL -
      EnumSet only supports the Set API.

      ---------- BEGIN SOURCE ----------
      EnumSet.allOf(SomeEnumSet).headSet(SomeEnumSet.SOMEMEMBER);

      won't compile.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Current plan is to reimplement EnumSet correctly. I'll look into posting the fix after I've done it.
      ###@###.### 2005-05-31 17:13:49 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jleesunw Jon Lee (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: