Class ReferenceSortedSets.UnmodifiableSortedSet<K>
- All Implemented Interfaces:
it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterable<K>,it.unimi.dsi.fastutil.objects.ObjectIterable<K>,ReferenceCollection<K>,ReferenceSet<K>,ReferenceSortedSet<K>,java.io.Serializable,java.lang.Iterable<K>,java.util.Collection<K>,java.util.Set<K>,java.util.SortedSet<K>
- Enclosing class:
- ReferenceSortedSets
public static class ReferenceSortedSets.UnmodifiableSortedSet<K> extends ReferenceSets.UnmodifiableSet<K> implements ReferenceSortedSet<K>, java.io.Serializable
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description booleanadd(K k)booleanaddAll(java.util.Collection<? extends K> c)voidclear()java.util.Comparator<? super K>comparator()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)Kfirst()voidforEach(java.util.function.Consumer<? super K> action)ReferenceSortedSet<K>headSet(K to)Returns a view of the portion of this sorted set whose elements are strictly less thantoElement.booleanisEmpty()it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<K>iterator(K from)Returns a type-specificBidirectionalIteratoron the elements in this set, starting from a given element of the domain (optional operation).Klast()java.util.stream.Stream<K>parallelStream()booleanremoveAll(java.util.Collection<?> c)booleanremoveIf(java.util.function.Predicate<? super K> filter)booleanretainAll(java.util.Collection<?> c)intsize()it.unimi.dsi.fastutil.objects.ObjectSpliterator<K>spliterator()Returns a type-specific spliterator on the elements of this collection.java.util.stream.Stream<K>stream()ReferenceSortedSet<K>subSet(K from, K to)Returns a view of the portion of this sorted set whose elements range fromfromElement, inclusive, totoElement, exclusive.ReferenceSortedSet<K>tailSet(K from)Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement.java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()Methods inherited from class it.unimi.dsi.fastutil.objects.ReferenceSets.UnmodifiableSet
equals, hashCode, removeMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.lang.Iterable
forEachMethods inherited from interface it.unimi.dsi.fastutil.objects.ReferenceSortedSet
spliteratorMethods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
-
Method Details
-
comparator
- Specified by:
comparatorin interfacejava.util.SortedSet<K>
-
subSet
Description copied from interface:ReferenceSortedSetReturns a view of the portion of this sorted set whose elements range fromfromElement, inclusive, totoElement, exclusive.- Specified by:
subSetin interfaceReferenceSortedSet<K>- Specified by:
subSetin interfacejava.util.SortedSet<K>- See Also:
SortedSet.subSet(Object,Object)
-
headSet
Description copied from interface:ReferenceSortedSetReturns a view of the portion of this sorted set whose elements are strictly less thantoElement.- Specified by:
headSetin interfaceReferenceSortedSet<K>- Specified by:
headSetin interfacejava.util.SortedSet<K>- See Also:
SortedSet.headSet(Object)
-
tailSet
Description copied from interface:ReferenceSortedSetReturns a view of the portion of this sorted set whose elements are greater than or equal tofromElement.- Specified by:
tailSetin interfaceReferenceSortedSet<K>- Specified by:
tailSetin interfacejava.util.SortedSet<K>- See Also:
SortedSet.tailSet(Object)
-
iterator
Description copied from interface:ReferenceCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfacejava.util.Collection<K>- Specified by:
iteratorin interfacejava.lang.Iterable<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectBidirectionalIterable<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
iteratorin interfaceReferenceCollection<K>- Specified by:
iteratorin interfaceReferenceSet<K>- Specified by:
iteratorin interfaceReferenceSortedSet<K>- Specified by:
iteratorin interfacejava.util.Set<K>- Returns:
- a type-specific iterator on the elements of this collection.
-
iterator
Description copied from interface:ReferenceSortedSetReturns a type-specificBidirectionalIteratoron 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:
iteratorin 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
- Specified by:
firstin interfacejava.util.SortedSet<K>
-
last
- Specified by:
lastin interfacejava.util.SortedSet<K>
-
add
- Specified by:
addin interfacejava.util.Collection<K>
-
size
public int size()- Specified by:
sizein interfacejava.util.Collection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacejava.util.Collection<K>
-
contains
public boolean contains(java.lang.Object o)- Specified by:
containsin interfacejava.util.Collection<K>
-
spliterator
Description copied from interface:ReferenceCollectionReturns 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:
spliteratorin interfacejava.util.Collection<K>- Specified by:
spliteratorin interfacejava.lang.Iterable<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
spliteratorin interfaceReferenceCollection<K>- Returns:
- a type-specific spliterator on the elements of this collection.
-
stream
- Specified by:
streamin interfacejava.util.Collection<K>
-
parallelStream
- Specified by:
parallelStreamin interfacejava.util.Collection<K>
-
clear
public void clear()- Specified by:
clearin interfacejava.util.Collection<K>
-
toArray
public <T> T[] toArray(T[] a)- Specified by:
toArrayin interfacejava.util.Collection<K>
-
toArray
public java.lang.Object[] toArray()- Specified by:
toArrayin interfacejava.util.Collection<K>
-
forEach
- Specified by:
forEachin interfacejava.lang.Iterable<K>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)- Specified by:
containsAllin interfacejava.util.Collection<K>
-
addAll
- Specified by:
addAllin interfacejava.util.Collection<K>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)- Specified by:
removeAllin interfacejava.util.Collection<K>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)- Specified by:
retainAllin interfacejava.util.Collection<K>
-
removeIf
- Specified by:
removeIfin interfacejava.util.Collection<K>
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-