(coll) LinkedHashMap to support ListIterators

XMLWordPrintable

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

      A DESCRIPTION OF THE REQUEST :
      Since LHM is ordered you can use LHM.iterator() LHM.values() and LHM.entries() to get items in order. However, you cannot get values in *reverse* order as there is no equivalent of Vector.listIterator(int).

      JUSTIFICATION :
      Performance and usability.

      This is what i expected it to do already !

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      LHM.values() and LHM.entries() to return an AbstractSequentialList rather than a Collection interface (implemented as an anonymous extension of AbstractCollection). **This would not break any existing applications**
      ACTUAL -
      LHM.values() and LHM.entries() return an AbstractCollection that cannot therefore present a ListIterator to the user.

      CUSTOMER SUBMITTED WORKAROUND :
      Currently you have to use :

      Collections.list( Collections.enumeration( linkedhashmap.values() ) );

      The performance of this is appalling considering the underlying collection is a linked list. Obviously, we maintain a second index to get around this.
      ###@###.### 2005-05-06 06:41:27 GMT

            Assignee:
            Stuart Marks
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: