/** * Returns an unmodifiable sorted set backed by the given sorted set. * <p> * This method uses the implementation in the decorators subpackage. * * @param <E> the element type * @param set the sorted set to make unmodifiable, must not be null * @return an unmodifiable set backed by the given set * @throws NullPointerException if the set is null */ public static <E> SortedSet<E> unmodifiableSortedSet(final SortedSet<E> set) { return UnmodifiableSortedSet.unmodifiableSortedSet(set); }
@Override public SortedSet<E> headSet(final E toElement) { final SortedSet<E> head = decorated().headSet(toElement); return unmodifiableSortedSet(head); }
@Override public SortedSet<E> tailSet(final E fromElement) { final SortedSet<E> tail = decorated().tailSet(fromElement); return unmodifiableSortedSet(tail); }
@Override public SortedSet<E> subSet(final E fromElement, final E toElement) { final SortedSet<E> sub = decorated().subSet(fromElement, toElement); return UnmodifiableSortedSet.unmodifiableSortedSet(sub); }
@Override public SortedSet<E> headSet(final E toElement) { final SortedSet<E> head = decorated().headSet(toElement); return UnmodifiableSortedSet.unmodifiableSortedSet(head); }
@Override public SortedSet<E> tailSet(final E fromElement) { final SortedSet<E> tail = decorated().tailSet(fromElement); return UnmodifiableSortedSet.unmodifiableSortedSet(tail); }
@Override public SortedSet<E> subSet(final E fromElement, final E toElement) { final SortedSet<E> sub = decorated().subSet(fromElement, toElement); return unmodifiableSortedSet(sub); }