-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
x86
-
windows_xp
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
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
- duplicates
-
JDK-8280836 JEP 431: Sequenced Collections
- Closed