An abstract implementation of a hash-based map that links entries to create an ordered map and which provides numerous points for subclasses to override.
This class implements all the features necessary for a subclass linked hash-based map. Key-value entries are stored in instances of the
LinkEntry
class which can be overridden and replaced. The iterators can similarly be replaced, without the need to replace the KeySet, EntrySet and Values view classes.
Overridable methods are provided to change the default hashing behaviour, and to change how entries are added to and removed from the map. Hopefully, all you need for unusual subclasses is here.
This implementation maintains order by original insertion, but subclasses may work differently. The
OrderedMap
interface is implemented to provide access to bidirectional iteration and extra convenience methods.
The
orderedMapIterator()
method provides direct access to a bidirectional iterator. The iterators from the other views can also be cast to
OrderedIterator
if required.
All the available iterators can be reset back to the start by casting to
ResettableIterator
and calling
reset()
.
The implementation is also designed to be subclassed, with lots of useful methods exposed.
@author java util LinkedHashMap
@author Matt Hall, John Watkinson, Stephen Colebourne
@version $Revision: 1.1 $ $Date: 2005/10/11 17:05:32 $
@since Commons Collections 3.0