Class ReferenceSortedSets.UnmodifiableSortedSet<K>
- All Implemented Interfaces:
ObjectBidirectionalIterable<K>
,ObjectIterable<K>
,ReferenceCollection<K>
,ReferenceSet<K>
,ReferenceSortedSet<K>
,Serializable
,Iterable<K>
,Collection<K>
,SequencedCollection<K>
,SequencedSet<K>
,Set<K>
,SortedSet<K>
- Enclosing class:
ReferenceSortedSets
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends K> c) void
clear()
Comparator
<? super K> boolean
boolean
containsAll
(Collection<?> c) first()
void
Returns a view of the portion of this sorted set whose elements are strictly less thantoElement
.boolean
isEmpty()
iterator()
Returns a type-specific iterator on the elements of this collection.Returns a type-specificBidirectionalIterator
on the elements in this set, starting from a given element of the domain (optional operation).last()
boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) int
size()
Returns a type-specific spliterator on the elements of this collection.stream()
Returns a view of the portion of this sorted set whose elements range fromfromElement
, inclusive, totoElement
, exclusive.Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement
.Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Methods inherited from class it.unimi.dsi.fastutil.objects.ReferenceSets.UnmodifiableSet
equals, hashCode, remove
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface it.unimi.dsi.fastutil.objects.ReferenceSortedSet
spliterator
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
Methods inherited from interface java.util.SortedSet
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Method Details
-
comparator
- Specified by:
comparator
in interfaceSortedSet<K>
-
subSet
Description copied from interface:ReferenceSortedSet
Returns a view of the portion of this sorted set whose elements range fromfromElement
, inclusive, totoElement
, exclusive. -
headSet
Description copied from interface:ReferenceSortedSet
Returns a view of the portion of this sorted set whose elements are strictly less thantoElement
. -
tailSet
Description copied from interface:ReferenceSortedSet
Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement
. -
iterator
Description copied from interface:ReferenceCollection
Returns a type-specific iterator on the elements of this collection.- Specified by:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectBidirectionalIterable<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceReferenceCollection<K>
- Specified by:
iterator
in interfaceReferenceSet<K>
- Specified by:
iterator
in interfaceReferenceSortedSet<K>
- Specified by:
iterator
in interfaceSet<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
iterator
Description copied from interface:ReferenceSortedSet
Returns a type-specificBidirectionalIterator
on the elements in this set, starting from a given element of the domain (optional operation).This method returns a type-specific bidirectional iterator with given starting point. The starting point is any element comparable to the elements of this set (even if it does not actually belong to the set). The next element of the returned iterator is the least element of the set that is greater than the starting point (if there are no elements greater than the starting point,
hasNext()
will returnfalse
). The previous element of the returned iterator is the greatest element of the set that is smaller than or equal to the starting point (if there are no elements smaller than or equal to the starting point,hasPrevious()
will returnfalse
).Note that passing the last element of the set as starting point and calling
previous()
you can traverse the entire set in reverse order.- Specified by:
iterator
in interfaceReferenceSortedSet<K>
- Parameters:
from
- an element to start from.- Returns:
- a bidirectional iterator on the element in this set, starting at the given element.
-
first
-
last
-
add
- Specified by:
add
in interfaceCollection<K>
-
size
public int size()- Specified by:
size
in interfaceCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<K>
-
contains
- Specified by:
contains
in interfaceCollection<K>
-
spliterator
Description copied from interface:ReferenceCollection
Returns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()
for more documentation on the requirements of the returned spliterator.- Specified by:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceObjectIterable<K>
- Specified by:
spliterator
in interfaceReferenceCollection<K>
- Returns:
- a type-specific spliterator on the elements of this collection.
-
stream
- Specified by:
stream
in interfaceCollection<K>
-
parallelStream
- Specified by:
parallelStream
in interfaceCollection<K>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<K>
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
-
forEach
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
-
addAll
- Specified by:
addAll
in interfaceCollection<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<K>
-
toString
-