Class UnmodifiableSortedSet<E>
- java.lang.Object
-
- org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
-
- org.apache.commons.collections4.set.AbstractSetDecorator<E>
-
- org.apache.commons.collections4.set.AbstractSortedSetDecorator<E>
-
- org.apache.commons.collections4.set.UnmodifiableSortedSet<E>
-
- Type Parameters:
E- the type of the elements in this set
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>,java.util.SortedSet<E>,Unmodifiable
public final class UnmodifiableSortedSet<E> extends AbstractSortedSetDecorator<E> implements Unmodifiable
Decorates anotherSortedSetto ensure it can't be altered.This class is Serializable from Commons Collections 3.1.
Attempts to modify it will result in an UnsupportedOperationException.
- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E object)booleanaddAll(java.util.Collection<? extends E> coll)voidclear()java.util.SortedSet<E>headSet(E toElement)java.util.Iterator<E>iterator()booleanremove(java.lang.Object object)booleanremoveAll(java.util.Collection<?> coll)booleanremoveIf(java.util.function.Predicate<? super E> filter)booleanretainAll(java.util.Collection<?> coll)java.util.SortedSet<E>subSet(E fromElement, E toElement)java.util.SortedSet<E>tailSet(E fromElement)static <E> java.util.SortedSet<E>unmodifiableSortedSet(java.util.SortedSet<E> set)Factory method to create an unmodifiable set.-
Methods inherited from class org.apache.commons.collections4.set.AbstractSortedSetDecorator
comparator, first, last
-
Methods inherited from class org.apache.commons.collections4.set.AbstractSetDecorator
equals, hashCode
-
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
contains, containsAll, isEmpty, size, toArray, toArray, toString
-
-
-
-
Method Detail
-
unmodifiableSortedSet
public static <E> java.util.SortedSet<E> unmodifiableSortedSet(java.util.SortedSet<E> set)
Factory method to create an unmodifiable set.- Type Parameters:
E- the element type- Parameters:
set- the set to decorate, must not be null- Returns:
- a new unmodifiable
SortedSet - Throws:
java.lang.NullPointerException- if set is null- Since:
- 4.0
-
iterator
public java.util.Iterator<E> iterator()
-
add
public boolean add(E object)
- Specified by:
addin interfacejava.util.Collection<E>- Specified by:
addin interfacejava.util.Set<E>- Overrides:
addin classAbstractCollectionDecorator<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
- Specified by:
addAllin interfacejava.util.Collection<E>- Specified by:
addAllin interfacejava.util.Set<E>- Overrides:
addAllin classAbstractCollectionDecorator<E>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>- Specified by:
clearin interfacejava.util.Set<E>- Overrides:
clearin classAbstractCollectionDecorator<E>
-
remove
public boolean remove(java.lang.Object object)
- Specified by:
removein interfacejava.util.Collection<E>- Specified by:
removein interfacejava.util.Set<E>- Overrides:
removein classAbstractCollectionDecorator<E>
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
- Specified by:
removeIfin interfacejava.util.Collection<E>- Overrides:
removeIfin classAbstractCollectionDecorator<E>- Since:
- 4.4
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
- Specified by:
removeAllin interfacejava.util.Collection<E>- Specified by:
removeAllin interfacejava.util.Set<E>- Overrides:
removeAllin classAbstractCollectionDecorator<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
- Specified by:
retainAllin interfacejava.util.Collection<E>- Specified by:
retainAllin interfacejava.util.Set<E>- Overrides:
retainAllin classAbstractCollectionDecorator<E>
-
subSet
public java.util.SortedSet<E> subSet(E fromElement, E toElement)
- Specified by:
subSetin interfacejava.util.SortedSet<E>- Overrides:
subSetin classAbstractSortedSetDecorator<E>
-
headSet
public java.util.SortedSet<E> headSet(E toElement)
- Specified by:
headSetin interfacejava.util.SortedSet<E>- Overrides:
headSetin classAbstractSortedSetDecorator<E>
-
-