Package it.unimi.dsi.fastutil.objects
Class ReferenceCollections.EmptyCollection<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K>
it.unimi.dsi.fastutil.objects.ReferenceCollections.EmptyCollection<K>
- All Implemented Interfaces:
ObjectIterable<K>,ReferenceCollection<K>,Iterable<K>,Collection<K>
- Direct Known Subclasses:
ReferenceBigLists.EmptyBigList,ReferenceLists.EmptyList,ReferenceSets.EmptySet
- Enclosing class:
- ReferenceCollections
public abstract static class ReferenceCollections.EmptyCollection<K> extends AbstractReferenceCollection<K>
An immutable class representing an empty type-specific collection.
This class may be useful to implement your own in case you subclass a type-specific collection.
-
Method Summary
Modifier and Type Method Description booleanaddAll(Collection<? extends K> c)voidclear()booleancontains(Object k)booleanequals(Object o)inthashCode()ObjectBidirectionalIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()Methods inherited from class java.util.AbstractCollection
add, containsAll, isEmpty, remove, toArrayMethods inherited from interface java.util.Collection
add, containsAll, isEmpty, parallelStream, remove, removeIf, spliterator, stream, toArray, toArray
-
Method Details
-
contains
- Specified by:
containsin interfaceCollection<K>- Overrides:
containsin classAbstractCollection<K>
-
toArray
- Specified by:
toArrayin interfaceCollection<K>- Overrides:
toArrayin classAbstractCollection<K>
-
iterator
Description copied from interface:ReferenceCollectionReturns a type-specific iterator on the elements of this collection.Note that 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.- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Specified by:
iteratorin interfaceReferenceCollection<K>- Specified by:
iteratorin classAbstractReferenceCollection<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
size
public int size()- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein classAbstractCollection<K>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<K>- Overrides:
clearin classAbstractCollection<K>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<K>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<K>- Overrides:
equalsin classObject
-
addAll
- Specified by:
addAllin interfaceCollection<K>- Overrides:
addAllin classAbstractCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>- Overrides:
removeAllin classAbstractCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>- Overrides:
retainAllin classAbstractCollection<K>
-