E - the type of the elements in this setpublic final class UnmodifiableNavigableSet<E> extends AbstractNavigableSetDecorator<E> implements Unmodifiable
NavigableSet to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID
Serialization version
|
| Modifier | Constructor and Description |
|---|---|
private |
UnmodifiableNavigableSet(java.util.NavigableSet<E> set)
Constructor that wraps (not copies).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object) |
boolean |
addAll(java.util.Collection<? extends E> coll) |
void |
clear() |
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() |
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 |
removeIf(java.util.function.Predicate<? super E> filter) |
boolean |
retainAll(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.
|
private void |
writeObject(java.io.ObjectOutputStream out)
Write the collection out using a custom routine.
|
ceiling, decorated, floor, higher, lower, pollFirst, pollLastcomparator, first, lastequals, hashCodecontains, containsAll, isEmpty, setCollection, size, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate static final long serialVersionUID
private UnmodifiableNavigableSet(java.util.NavigableSet<E> set)
set - the set to decorate, must not be nulljava.lang.NullPointerException - if set is nullpublic static <E> java.util.NavigableSet<E> unmodifiableNavigableSet(java.util.NavigableSet<E> set)
E - the element typeset - the set to decorate, must not be nullNavigableSetjava.lang.NullPointerException - if set is nullpublic java.util.Iterator<E> iterator()
public boolean add(E object)
add in interface java.util.Collection<E>add in interface java.util.Set<E>add in class AbstractCollectionDecorator<E>public boolean addAll(java.util.Collection<? extends E> coll)
addAll in interface java.util.Collection<E>addAll in interface java.util.Set<E>addAll in class AbstractCollectionDecorator<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.Set<E>clear in class AbstractCollectionDecorator<E>public boolean remove(java.lang.Object object)
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>remove in class AbstractCollectionDecorator<E>public boolean removeIf(java.util.function.Predicate<? super E> filter)
removeIf in interface java.util.Collection<E>removeIf in class AbstractCollectionDecorator<E>public boolean removeAll(java.util.Collection<?> coll)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.Set<E>removeAll in class AbstractCollectionDecorator<E>public boolean retainAll(java.util.Collection<?> coll)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.Set<E>retainAll in class AbstractCollectionDecorator<E>public java.util.SortedSet<E> subSet(E fromElement, E toElement)
subSet in interface java.util.NavigableSet<E>subSet in interface java.util.SortedSet<E>subSet in class AbstractSortedSetDecorator<E>public java.util.SortedSet<E> headSet(E toElement)
headSet in interface java.util.NavigableSet<E>headSet in interface java.util.SortedSet<E>headSet in class AbstractSortedSetDecorator<E>public java.util.SortedSet<E> tailSet(E fromElement)
tailSet in interface java.util.NavigableSet<E>tailSet in interface java.util.SortedSet<E>tailSet in class AbstractSortedSetDecorator<E>public java.util.NavigableSet<E> descendingSet()
descendingSet in interface java.util.NavigableSet<E>descendingSet in class AbstractNavigableSetDecorator<E>public java.util.Iterator<E> descendingIterator()
descendingIterator in interface java.util.NavigableSet<E>descendingIterator in class AbstractNavigableSetDecorator<E>public java.util.NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
subSet in interface java.util.NavigableSet<E>subSet in class AbstractNavigableSetDecorator<E>public java.util.NavigableSet<E> headSet(E toElement, boolean inclusive)
headSet in interface java.util.NavigableSet<E>headSet in class AbstractNavigableSetDecorator<E>public java.util.NavigableSet<E> tailSet(E fromElement, boolean inclusive)
tailSet in interface java.util.NavigableSet<E>tailSet in class AbstractNavigableSetDecorator<E>private void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
out - the output streamjava.io.IOException - if an error occurs while writing to the streamprivate void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
in - the input streamjava.io.IOException - if an error occurs while reading from the streamjava.lang.ClassNotFoundException - if an object read from the stream can not be loaded