Package it.unimi.dsi.fastutil.objects
Interface ReferenceCollection<K>
- All Superinterfaces:
java.util.Collection<K>,java.lang.Iterable<K>,it.unimi.dsi.fastutil.objects.ObjectIterable<K>
- All Known Subinterfaces:
ReferenceBigList<K>,ReferenceList<K>,ReferenceSet<K>,ReferenceSortedSet<K>
- All Known Implementing Classes:
AbstractReferenceBigList,AbstractReferenceBigList.ReferenceRandomAccessSubList,AbstractReferenceBigList.ReferenceSubList,AbstractReferenceCollection,AbstractReferenceList,AbstractReferenceList.ReferenceRandomAccessSubList,AbstractReferenceList.ReferenceSubList,AbstractReferenceSet,AbstractReferenceSortedSet,ReferenceArrayList,ReferenceArraySet,ReferenceBigArrayBigList,ReferenceBigLists.EmptyBigList,ReferenceBigLists.ListBigList,ReferenceBigLists.Singleton,ReferenceBigLists.SynchronizedBigList,ReferenceBigLists.UnmodifiableBigList,ReferenceCollections.EmptyCollection,ReferenceCollections.IterableCollection,ReferenceImmutableList,ReferenceLinkedOpenHashSet,ReferenceLists.EmptyList,ReferenceLists.Singleton,ReferenceLists.SynchronizedList,ReferenceLists.SynchronizedRandomAccessList,ReferenceLists.UnmodifiableList,ReferenceLists.UnmodifiableRandomAccessList,ReferenceOpenHashBigSet,ReferenceOpenHashSet,ReferenceSets.EmptySet,ReferenceSets.Singleton,ReferenceSets.SynchronizedSet,ReferenceSets.UnmodifiableSet,ReferenceSortedSets.EmptySet,ReferenceSortedSets.Singleton,ReferenceSortedSets.SynchronizedSortedSet,ReferenceSortedSets.UnmodifiableSortedSet
public interface ReferenceCollection<K>
extends java.util.Collection<K>, it.unimi.dsi.fastutil.objects.ObjectIterable<K>
A type-specific
Collection; provides some additional methods
that use polymorphism to avoid (un)boxing.
Additionally, this class defines strengthens (again) iterator().
- See Also:
Collection
-
Method Summary
Modifier and Type Method Description it.unimi.dsi.fastutil.objects.ObjectIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.default it.unimi.dsi.fastutil.objects.ObjectSpliterator<K>spliterator()Returns a type-specific spliterator on the elements of this collection.Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, stream, toArray, toArray, toArrayMethods inherited from interface java.lang.Iterable
forEach
-
Method Details
-
iterator
it.unimi.dsi.fastutil.objects.ObjectIterator<K> iterator()Returns 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.ObjectIterable<K>- Returns:
- a type-specific iterator on the elements of this collection.
- API Notes:
- This specification strengthens the one given in
Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsCollection.
-
spliterator
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:
spliteratorin interfacejava.util.Collection<K>- Specified by:
spliteratorin interfacejava.lang.Iterable<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Returns:
- a type-specific spliterator on the elements of this collection.
- Since:
- 8.5.0
- API Notes:
- This specification strengthens the one given in
Collection.spliterator().Also, this is generally the only
spliteratormethod subclasses should override. - Implementation Specification:
- The default implementation returns a late-binding spliterator (see
Spliteratorfor documentation on what binding policies mean) that wraps this instance's type specificiterator().Additionally, it reports
Spliterator.SIZED - Implementation Notes:
- As this default implementation wraps the iterator, and
Iteratoris an inherently linear API, the returned spliterator will yield limited performance gains when run in parallel contexts, as the returned spliterator'strySplit()will have linear runtime.
-