E
- the type of elements contained in the list. The list is covariant on its element type.public ImmutableSortedSet<E> extends ImmutableSet<E>
An interface that mimics the original SortedSet but without exposing modification functions to Kotlin source codes.
Modifications are strictly forbidden after the map is created.
Modifier and Type | Method and Description |
---|---|
java.util.Comparator<? super E> |
comparator()
Returns the comparator used to order the elements in this set,
or null if this set uses the natural ordering of its elements.
|
E |
first()
Returns the first (lowest) element currently in this set.
|
ImmutableSortedSet<E> |
head(E toElement)
Returns a view of the portion of this set whose elements are
strictly less than toElement. 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.
|
E |
last()
Returns the last (highest) element currently in this set.
|
ImmutableSortedSet<E> |
sub(E fromElement,
E toElement)
Returns a view of the portion of this set whose elements range
from fromElement, inclusive, to toElement,
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.
|
ImmutableSortedSet<E> |
tail(E fromElement)
Returns a view of the portion of this set whose elements are
greater than or equal to fromElement. 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.
|
java.util.Comparator<? super E> comparator()
Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.
ImmutableSortedSet<E> sub(E fromElement, E toElement)
Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, 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.
The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.
fromElement
- low endpoint (inclusive) of the returned settoElement
- high endpoint (exclusive) of the returned setImmutableSortedSet<E> head(E toElement)
Returns a view of the portion of this set whose elements are strictly less than toElement. 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.
The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.
toElement
- high endpoint (exclusive) of the returned setImmutableSortedSet<E> tail(E fromElement)
Returns a view of the portion of this set whose elements are greater than or equal to fromElement. 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.
The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.
fromElement
- low endpoint (inclusive) of the returned setE first()
Returns the first (lowest) element currently in this set.
E last()
Returns the last (highest) element currently in this set.