(coll) EnumSet/EnumMap should implement NavigableX or SequencedX interfaces

XMLWordPrintable

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

      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

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

              Created:
              Updated:
              Imported:
              Indexed: