public final class UnmodifiableSortedSet extends AbstractSortedSetDecorator implements Unmodifiable, java.io.Serializable
SortedSet
to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Serialization version
|
collection
Modifier | Constructor and Description |
---|---|
private |
UnmodifiableSortedSet(java.util.SortedSet set)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object object) |
boolean |
addAll(java.util.Collection coll) |
void |
clear() |
static java.util.SortedSet |
decorate(java.util.SortedSet set)
Factory method to create an unmodifiable set.
|
java.util.SortedSet |
headSet(java.lang.Object toElement) |
java.util.Iterator |
iterator() |
private void |
readObject(java.io.ObjectInputStream in)
Read the collection in using a custom routine.
|
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection coll) |
boolean |
retainAll(java.util.Collection coll) |
java.util.SortedSet |
subSet(java.lang.Object fromElement,
java.lang.Object toElement) |
java.util.SortedSet |
tailSet(java.lang.Object fromElement) |
private void |
writeObject(java.io.ObjectOutputStream out)
Write the collection out using a custom routine.
|
comparator, first, getSortedSet, last
getSet
contains, containsAll, equals, getCollection, hashCode, isEmpty, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID
private UnmodifiableSortedSet(java.util.SortedSet set)
set
- the set to decorate, must not be nulljava.lang.IllegalArgumentException
- if set is nullpublic static java.util.SortedSet decorate(java.util.SortedSet set)
set
- the set to decorate, must not be nulljava.lang.IllegalArgumentException
- if set is nullprivate void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- the output streamjava.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- the input streamjava.io.IOException
java.lang.ClassNotFoundException
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
iterator
in class AbstractCollectionDecorator
public boolean add(java.lang.Object object)
add
in interface java.util.Collection
add
in interface java.util.Set
add
in class AbstractCollectionDecorator
public boolean addAll(java.util.Collection coll)
addAll
in interface java.util.Collection
addAll
in interface java.util.Set
addAll
in class AbstractCollectionDecorator
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.Set
clear
in class AbstractCollectionDecorator
public boolean remove(java.lang.Object object)
remove
in interface java.util.Collection
remove
in interface java.util.Set
remove
in class AbstractCollectionDecorator
public boolean removeAll(java.util.Collection coll)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.Set
removeAll
in class AbstractCollectionDecorator
public boolean retainAll(java.util.Collection coll)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
retainAll
in class AbstractCollectionDecorator
public java.util.SortedSet subSet(java.lang.Object fromElement, java.lang.Object toElement)
subSet
in interface java.util.SortedSet
subSet
in class AbstractSortedSetDecorator
public java.util.SortedSet headSet(java.lang.Object toElement)
headSet
in interface java.util.SortedSet
headSet
in class AbstractSortedSetDecorator
public java.util.SortedSet tailSet(java.lang.Object fromElement)
tailSet
in interface java.util.SortedSet
tailSet
in class AbstractSortedSetDecorator