Class UnmodifiableNavigableSet<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.AbstractNavigableSetDecorator<E>
-
- org.apache.commons.collections4.set.UnmodifiableNavigableSet<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.NavigableSet<E>,java.util.Set<E>,java.util.SortedSet<E>,Unmodifiable
public final class UnmodifiableNavigableSet<E> extends AbstractNavigableSetDecorator<E> implements Unmodifiable
Decorates anotherNavigableSetto ensure it can't be altered.Attempts to modify it will result in an UnsupportedOperationException.
- Since:
- 4.1
- 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.Iterator<E>descendingIterator()java.util.NavigableSet<E>descendingSet()java.util.SortedSet<E>headSet(E toElement)java.util.NavigableSet<E>headSet(E toElement, boolean inclusive)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.NavigableSet<E>subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)java.util.SortedSet<E>subSet(E fromElement, E toElement)java.util.SortedSet<E>tailSet(E fromElement)java.util.NavigableSet<E>tailSet(E fromElement, boolean inclusive)static <E> java.util.NavigableSet<E>unmodifiableNavigableSet(java.util.NavigableSet<E> set)Factory method to create an unmodifiable set.-
Methods inherited from class org.apache.commons.collections4.set.AbstractNavigableSetDecorator
ceiling, floor, higher, lower, pollFirst, pollLast
-
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
-
unmodifiableNavigableSet
public static <E> java.util.NavigableSet<E> unmodifiableNavigableSet(java.util.NavigableSet<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
NavigableSet - Throws:
java.lang.NullPointerException- if set is null
-
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.NavigableSet<E>- 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.NavigableSet<E>- Specified by:
headSetin interfacejava.util.SortedSet<E>- Overrides:
headSetin classAbstractSortedSetDecorator<E>
-
tailSet
public java.util.SortedSet<E> tailSet(E fromElement)
- Specified by:
tailSetin interfacejava.util.NavigableSet<E>- Specified by:
tailSetin interfacejava.util.SortedSet<E>- Overrides:
tailSetin classAbstractSortedSetDecorator<E>
-
descendingSet
public java.util.NavigableSet<E> descendingSet()
- Specified by:
descendingSetin interfacejava.util.NavigableSet<E>- Overrides:
descendingSetin classAbstractNavigableSetDecorator<E>
-
descendingIterator
public java.util.Iterator<E> descendingIterator()
- Specified by:
descendingIteratorin interfacejava.util.NavigableSet<E>- Overrides:
descendingIteratorin classAbstractNavigableSetDecorator<E>
-
subSet
public java.util.NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSetin interfacejava.util.NavigableSet<E>- Overrides:
subSetin classAbstractNavigableSetDecorator<E>
-
headSet
public java.util.NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSetin interfacejava.util.NavigableSet<E>- Overrides:
headSetin classAbstractNavigableSetDecorator<E>
-
-