Returns a read-only view of map: lookups, iteration and the key, entry and value views read
the map, so the owner's changes show through, and every method that would change it, its views
or its entries throws UnsupportedOperationError. Entries read the map's entries live. The view
equals, and hashes like, the map. On an access-ordered LinkedHashMap, get through the view is
an access, as on the map.
When map is already a view this function returns (printed as UnmodifiableMap), it is returned
unchanged. When it is any other unmodifiable view or immutable collection from this copy of the
library, the new view reads that collection's source instead, and entries it hands out stay
read-only, so read-only wrappers never nest.
Time: O(1); each operation costs what the map's costs.
Returns a read-only view of
map: lookups, iteration and the key, entry and value views read the map, so the owner's changes show through, and every method that would change it, its views or its entries throwsUnsupportedOperationError. Entries read the map's entries live. The view equals, and hashes like, the map. On an access-orderedLinkedHashMap,getthrough the view is an access, as on the map.When
mapis already a view this function returns (printed asUnmodifiableMap), it is returned unchanged. When it is any other unmodifiable view or immutable collection from this copy of the library, the new view reads that collection's source instead, and entries it hands out stay read-only, so read-only wrappers never nest.Time: O(1); each operation costs what the map's costs.