Package eu.simuline.util
Class CollectionsExt.ImmutableSortedSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- eu.simuline.util.CollectionsExt.AbstractImmutableCollection<SortedSet<E>,E>
-
- eu.simuline.util.CollectionsExt.ImmutableSortedSet<E>
-
- Type Parameters:
E- the class of the elements of this list.
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>,SortedSet<E>
- Enclosing class:
- CollectionsExt<E>
public static final class CollectionsExt.ImmutableSortedSet<E> extends CollectionsExt.AbstractImmutableCollection<SortedSet<E>,E> implements SortedSet<E>
A sorted set which prevents being modified by throwing an exception for the modifying methods.
-
-
Constructor Summary
Constructors Constructor Description ImmutableSortedSet(Set<CollectionsExt.Modification> mods, SortedSet<E> set)ImmutableSortedSet(SortedSet<E> set)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparator<? super E>comparator()Efirst()SortedSet<E>headSet(E toElement)Returns a view of the portion of this set whose elements are strictly less thantoElement.Elast()SortedSet<E>subSet(E fromElement, E toElement)Returns a view of the portion of this set whose elements range fromfromElement, inclusive, totoElement, exclusive.SortedSet<E>tailSet(E fromElement)Returns a view of the portion of this set whose elements are greater than or equal tofromElement.SortedSet<E>unrestricted()Returns the underlying set without the restrictions imposed by thisCollectionsExt.ImmutableCollection.-
Methods inherited from class eu.simuline.util.CollectionsExt.AbstractImmutableCollection
add, addAll, allowedModifications, allowModification, allowModifications, clear, iterator, remove, removeAll, removeIf, retainAll, size, toString
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
spliterator
-
-
-
-
Method Detail
-
unrestricted
public SortedSet<E> unrestricted()
Description copied from class:CollectionsExt.AbstractImmutableCollectionReturns the underlying set without the restrictions imposed by thisCollectionsExt.ImmutableCollection. Note that the result may still throwUnsupportedOperationExceptions depending on the implementation.- Specified by:
unrestrictedin classCollectionsExt.AbstractImmutableCollection<SortedSet<E>,E>
-
comparator
public Comparator<? super E> comparator()
- Specified by:
comparatorin interfaceSortedSet<E>
-
headSet
public SortedSet<E> headSet(E toElement)
Returns a view of the portion of this set whose elements are strictly less thantoElement. For information on backing seesubSet(Object, Object).
-
subSet
public SortedSet<E> subSet(E fromElement, E toElement)
Returns a view of the portion of this set whose elements range fromfromElement, inclusive, totoElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports. In particular, changes of the allowed modifications (returned byCollectionsExt.AbstractImmutableCollection.allowedModifications()) of the returned set are reflected in this set, and vice-versa.
-
-