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 it.unimi.dsi.fastutil.objects.AbstractReferenceCollection
toString
-
Methods inherited from class java.util.AbstractCollection
add, containsAll, isEmpty, remove, toArray
-
Methods inherited from interface java.util.Collection
add, containsAll, isEmpty, parallelStream, remove, removeIf, spliterator, stream, toArray, toArray
-
-
-
-
Method Detail
-
contains
public boolean contains(Object k)
- Specified by:
containsin interfaceCollection<K>- Overrides:
containsin classAbstractCollection<K>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<K>- Overrides:
toArrayin classAbstractCollection<K>
-
iterator
public ObjectBidirectionalIterator<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
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<K>- Overrides:
equalsin classObject
-
addAll
public boolean addAll(Collection<? extends K> c)
- Specified by:
addAllin interfaceCollection<K>- Overrides:
addAllin classAbstractCollection<K>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<K>- Overrides:
removeAllin classAbstractCollection<K>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<K>- Overrides:
retainAllin classAbstractCollection<K>
-
-