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:
Serializable,Iterable<E>,Collection<E>,NavigableSet<E>,Set<E>,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(Collection<? extends E> coll)voidclear()Iterator<E>descendingIterator()NavigableSet<E>descendingSet()SortedSet<E>headSet(E toElement)NavigableSet<E>headSet(E toElement, boolean inclusive)Iterator<E>iterator()booleanremove(Object object)booleanremoveAll(Collection<?> coll)booleanremoveIf(Predicate<? super E> filter)booleanretainAll(Collection<?> coll)NavigableSet<E>subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)SortedSet<E>subSet(E fromElement, E toElement)SortedSet<E>tailSet(E fromElement)NavigableSet<E>tailSet(E fromElement, boolean inclusive)static <E> NavigableSet<E>unmodifiableNavigableSet(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
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.Set
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
comparator, first, last, spliterator
-
-
-
-
Method Detail
-
unmodifiableNavigableSet
public static <E> NavigableSet<E> unmodifiableNavigableSet(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:
NullPointerException- if set is null
-
iterator
public Iterator<E> iterator()
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceNavigableSet<E>- Specified by:
iteratorin interfaceSet<E>- Overrides:
iteratorin classAbstractCollectionDecorator<E>
-
add
public boolean add(E object)
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceSet<E>- Overrides:
addin classAbstractCollectionDecorator<E>
-
addAll
public boolean addAll(Collection<? extends E> coll)
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceSet<E>- Overrides:
addAllin classAbstractCollectionDecorator<E>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classAbstractCollectionDecorator<E>
-
remove
public boolean remove(Object object)
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceSet<E>- Overrides:
removein classAbstractCollectionDecorator<E>
-
removeIf
public boolean removeIf(Predicate<? super E> filter)
- Specified by:
removeIfin interfaceCollection<E>- Overrides:
removeIfin classAbstractCollectionDecorator<E>- Since:
- 4.4
-
removeAll
public boolean removeAll(Collection<?> coll)
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceSet<E>- Overrides:
removeAllin classAbstractCollectionDecorator<E>
-
retainAll
public boolean retainAll(Collection<?> coll)
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceSet<E>- Overrides:
retainAllin classAbstractCollectionDecorator<E>
-
subSet
public SortedSet<E> subSet(E fromElement, E toElement)
- Specified by:
subSetin interfaceNavigableSet<E>- Specified by:
subSetin interfaceSortedSet<E>- Overrides:
subSetin classAbstractSortedSetDecorator<E>
-
headSet
public SortedSet<E> headSet(E toElement)
- Specified by:
headSetin interfaceNavigableSet<E>- Specified by:
headSetin interfaceSortedSet<E>- Overrides:
headSetin classAbstractSortedSetDecorator<E>
-
tailSet
public SortedSet<E> tailSet(E fromElement)
- Specified by:
tailSetin interfaceNavigableSet<E>- Specified by:
tailSetin interfaceSortedSet<E>- Overrides:
tailSetin classAbstractSortedSetDecorator<E>
-
descendingSet
public NavigableSet<E> descendingSet()
- Specified by:
descendingSetin interfaceNavigableSet<E>- Overrides:
descendingSetin classAbstractNavigableSetDecorator<E>
-
descendingIterator
public Iterator<E> descendingIterator()
- Specified by:
descendingIteratorin interfaceNavigableSet<E>- Overrides:
descendingIteratorin classAbstractNavigableSetDecorator<E>
-
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSetin interfaceNavigableSet<E>- Overrides:
subSetin classAbstractNavigableSetDecorator<E>
-
headSet
public NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSetin interfaceNavigableSet<E>- Overrides:
headSetin classAbstractNavigableSetDecorator<E>
-
tailSet
public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
- Specified by:
tailSetin interfaceNavigableSet<E>- Overrides:
tailSetin classAbstractNavigableSetDecorator<E>
-
-