Returns a read-only view of list: indexes, subList, reversed() and cursors read the list,
so the owner's changes show through, and every change — on the view, its sub-lists and reversed
views, and its cursors — throws UnsupportedOperationError before its arguments are checked.
The view equals, and hashes like, the list.
When list is already a view this function returns (printed as UnmodifiableList, its sub-lists
and reversed views included), 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 list's costs.
Returns a read-only view of
list: indexes,subList,reversed()and cursors read the list, so the owner's changes show through, and every change — on the view, its sub-lists and reversed views, and its cursors — throwsUnsupportedOperationErrorbefore its arguments are checked. The view equals, and hashes like, the list.When
listis already a view this function returns (printed asUnmodifiableList, its sub-lists and reversed views included), 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 list's costs.