J
Jan Burse
Dear All,
I just wonder whether I have overlooked something.
But could it be that LinkedHashMap is lacking the
following API:
Map<K,V> descendingMap();
So I can only iterate from oldest to youngest, and
not the other direction?
Although under the hood it uses a double linked list,
and a reverse iterator would be simple.
Also the whole matter seems to be complicated, since
the other collections have descendingMap() in an
Interface NavigableMap, which extends SortedMap.
But SortedMap map assumes a compartor, whereby the
sorting in LinkedHashMap is implicit.
Is there some shortcut to arrive at a reverse iterator
of LinkedHashMap?
(Troll disclaimer: No I have no SSCCE (Short, Self
Contained, Correct (Compilable), Example). This is
a conceptual question.)
Bye
I just wonder whether I have overlooked something.
But could it be that LinkedHashMap is lacking the
following API:
Map<K,V> descendingMap();
So I can only iterate from oldest to youngest, and
not the other direction?
Although under the hood it uses a double linked list,
and a reverse iterator would be simple.
Also the whole matter seems to be complicated, since
the other collections have descendingMap() in an
Interface NavigableMap, which extends SortedMap.
But SortedMap map assumes a compartor, whereby the
sorting in LinkedHashMap is implicit.
Is there some shortcut to arrive at a reverse iterator
of LinkedHashMap?
(Troll disclaimer: No I have no SSCCE (Short, Self
Contained, Correct (Compilable), Example). This is
a conceptual question.)
Bye