views:

145

answers:

1

java.util.Collections has several unmodifiable methods that provide unmodifiable collection views by wrapping collections in decorators that prohibit mutation operations.

Java 6 added support for java.util.NavigableSet and java.util.NavigableMap.

I'd like to be able to have unmodifiable NavigableSets and NavigableMaps, but java.util.Collections#unmodifiableSortedSet(SortedSet) and java.util.Collections#unmodifiableSortedMap(SortedMap) are not sufficient because they do not support the operations that are particular to NavigableSet and NavigableMap.

Are there de-facto implementations for unmodifiableNavigableSet and unmodifiableNavigableMap?

+1  A: 

@Christian Semrau shoulda posted his comment as an answer. Go upvote his comment. :)

Kevin Bourrillion