Package it.unimi.dsi.fastutil.objects
Interface ObjectCollection<K>
- All Superinterfaces:
Collection<K>,Iterable<K>,ObjectIterable<K>
- All Known Subinterfaces:
ObjectList<K>
- All Known Implementing Classes:
AbstractObjectCollection,AbstractObjectList,AbstractObjectList.ObjectRandomAccessSubList,AbstractObjectList.ObjectSubList,ObjectArrayList,ObjectArrayList.SubList,ObjectCollections.EmptyCollection,ObjectCollections.IterableCollection,ObjectImmutableList,ObjectLists.EmptyList,ObjectLists.Singleton,ObjectLists.SynchronizedList,ObjectLists.SynchronizedRandomAccessList,ObjectLists.UnmodifiableList,ObjectLists.UnmodifiableRandomAccessList
A type-specific
Collection; provides some additional methods
that use polymorphism to avoid (un)boxing.
Additionally, this class defines strengthens (again) iterator().
This interface specifies reference equality semantics (members will be compared equal with
== instead of equals), which may result in breaks in contract
if attempted to be used with non reference-equality semantics based Collections. For example, a
aReferenceCollection.equals(aObjectCollection) may return different a different result then
aObjectCollection.equals(aReferenceCollection), in violation of equals's
contract requiring it being symmetric.
- See Also:
-
Method Summary
-
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 interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
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 interfaceCollection<K>- Specified by:
spliteratorin interfaceIterable<K>- Specified by:
spliteratorin interfaceObjectIterable<K>- Returns:
- a type-specific spliterator on the elements of this collection.
- Since:
- 8.5.0
-