Should LinkedHashMap expose the Entries subclass

Paulo Levi i30817 at
Sat Aug 18 14:18:22 UTC 2012

I'm trying to subclass LinkedHashMap so i can add new indexed iterator
ListIterator from(E e)

So, getEntry(e) is package protected and i though 'easy, since the entries
in this map are nodes on the list i can easily use that to make a iterator
by placing my subclass on the 'java.util' namespace'.

Not so fast; both header (the linked list guardian), modcount (the iterator
failsafe iterator data) and more importantly the double linked Entry
subclass are all private - so it seems my subclass is going to become a
mess of reflection and my access times will suffer consequentially (though
probably not as bad as copying the data).

What i'm asking is if is there any change of the 'Linked' subclasses either
returning a list iterator on their iterators, or at least making the
internal data fields protected or package protected?

More information about the discuss mailing list