Class UnmodifiableSortedSet
java.lang.Object
org.apache.commons.collections.collection.AbstractCollectionDecorator
org.apache.commons.collections.set.AbstractSetDecorator
org.apache.commons.collections.set.AbstractSortedSetDecorator
org.apache.commons.collections.set.UnmodifiableSortedSet
- All Implemented Interfaces:
Serializable,Iterable,Collection,Set,SortedSet,Unmodifiable
public final class UnmodifiableSortedSet
extends AbstractSortedSetDecorator
implements Unmodifiable, Serializable
Decorates another
SortedSet to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
- Since:
- Commons Collections 3.0
- Version:
- $Revision: 646777 $ $Date: 2008-04-10 14:33:15 +0200 (Thu, 10 Apr 2008) $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longSerialization versionFields inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator
collection -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstructor that wraps (not copies). -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection coll) voidclear()static SortedSetFactory method to create an unmodifiable set.iterator()private voidRead the collection in using a custom routine.booleanbooleanremoveAll(Collection coll) booleanretainAll(Collection coll) private voidWrite the collection out using a custom routine.Methods inherited from class org.apache.commons.collections.set.AbstractSortedSetDecorator
comparator, first, getSortedSet, lastMethods inherited from class org.apache.commons.collections.set.AbstractSetDecorator
getSetMethods inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator
contains, containsAll, equals, getCollection, hashCode, isEmpty, size, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.Set
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArrayMethods inherited from interface java.util.SortedSet
spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version- See Also:
-
-
Constructor Details
-
UnmodifiableSortedSet
Constructor that wraps (not copies).- Parameters:
set- the set to decorate, must not be null- Throws:
IllegalArgumentException- if set is null
-
-
Method Details
-
decorate
Factory method to create an unmodifiable set.- Parameters:
set- the set to decorate, must not be null- Throws:
IllegalArgumentException- if set is null
-
writeObject
Write the collection out using a custom routine.- Parameters:
out- the output stream- Throws:
IOException
-
readObject
Read the collection in using a custom routine.- Parameters:
in- the input stream- Throws:
IOExceptionClassNotFoundException
-
iterator
- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin interfaceSet- Overrides:
iteratorin classAbstractCollectionDecorator
-
add
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceSet- Overrides:
addin classAbstractCollectionDecorator
-
addAll
- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceSet- Overrides:
addAllin classAbstractCollectionDecorator
-
clear
public void clear()- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceSet- Overrides:
clearin classAbstractCollectionDecorator
-
remove
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceSet- Overrides:
removein classAbstractCollectionDecorator
-
removeAll
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceSet- Overrides:
removeAllin classAbstractCollectionDecorator
-
retainAll
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceSet- Overrides:
retainAllin classAbstractCollectionDecorator
-
subSet
- Specified by:
subSetin interfaceSortedSet- Overrides:
subSetin classAbstractSortedSetDecorator
-
headSet
- Specified by:
headSetin interfaceSortedSet- Overrides:
headSetin classAbstractSortedSetDecorator
-
tailSet
- Specified by:
tailSetin interfaceSortedSet- Overrides:
tailSetin classAbstractSortedSetDecorator
-