Basic implementation of an unmodifiable Map.
Basic implementation of an unmodifiable Map.
This class has a basic implementation of all but two of the members of
an umodifiable Map.
A simple unmodifiable Map
class can be implemented by extending this
class and implementing keys
and operator[]
.
Modifying operations throw when used.
The remaining non-modifying operations are implemented in terms of keys
and operator[]
.
The keys
iterable should have efficient length and contains
operations, and it should catch concurrent modifications of the keys
while iterating.
A more efficient implementation is usually possible by overriding some of the other members as well.