bb.util
Class Collections2

java.lang.Object
  extended by bb.util.Collections2

public class Collections2
extends Object

Adds functionality that is missing from Collections. There is no reason for this class other than oversight on Sun's part: if I could convince Sun to include this stuff in their Collections class then could eliminate this.

This class is multithread safe: it is stateless.

Author:
Brent Boyer

Nested Class Summary
static class Collections2.UnitTest
          See the Overview page of the project's javadocs for a general description of this unit test class.
(package private) static class Collections2.UnmodifiableNavigableSet<E>
           
 
Constructor Summary
private Collections2()
          This private constructor suppresses the default (public) constructor, ensuring non-instantiability.
 
Method Summary
static
<E> NavigableSet<E>
unmodifiableNavigableSet(NavigableSet<E> navigableSet)
          Returns an unmodifiable view of navigableSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Collections2

private Collections2()
This private constructor suppresses the default (public) constructor, ensuring non-instantiability.

Method Detail

unmodifiableNavigableSet

public static <E> NavigableSet<E> unmodifiableNavigableSet(NavigableSet<E> navigableSet)
Returns an unmodifiable view of navigableSet. This method allows modules to safely provide users with direct "read-only" access of internal NavigableSets. Query operations on the result "read through" to navigableSet, and attempts to modify the result, whether direct or via its iterator, result in an UnsupportedOperationException.

The returned collection will be Serializable if navigableSet is Serializable.

Parameters:
navigableSet - the NavigableSet for which an unmodifiable view is to be returned
Returns:
an unmodifiable view of navigableSet