E
- the type of the elements in this setpublic final class UnmodifiableSortedSet<E> extends AbstractSortedSetDecorator<E> implements Unmodifiable
SortedSet
to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
Attempts to modify it will result in an UnsupportedOperationException.
Modifier and Type | Method and Description |
---|---|
boolean |
add(E object) |
boolean |
addAll(Collection<? extends E> coll) |
void |
clear() |
SortedSet<E> |
headSet(E toElement) |
Iterator<E> |
iterator() |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> coll) |
boolean |
retainAll(Collection<?> coll) |
SortedSet<E> |
subSet(E fromElement,
E toElement) |
SortedSet<E> |
tailSet(E fromElement) |
static <E> SortedSet<E> |
unmodifiableSortedSet(SortedSet<E> set)
Factory method to create an unmodifiable set.
|
comparator, decorated, first, last
equals, hashCode
contains, containsAll, isEmpty, setCollection, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
parallelStream, removeIf, stream
public static <E> SortedSet<E> unmodifiableSortedSet(SortedSet<E> set)
E
- the element typeset
- the set to decorate, must not be nullSortedSet
NullPointerException
- if set is nullpublic boolean add(E object)
add
in interface Collection<E>
add
in interface Set<E>
add
in class AbstractCollectionDecorator<E>
public boolean addAll(Collection<? extends E> coll)
addAll
in interface Collection<E>
addAll
in interface Set<E>
addAll
in class AbstractCollectionDecorator<E>
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractCollectionDecorator<E>
public boolean remove(Object object)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractCollectionDecorator<E>
public boolean removeAll(Collection<?> coll)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractCollectionDecorator<E>
public boolean retainAll(Collection<?> coll)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollectionDecorator<E>
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.