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 TypeMethodDescriptionboolean
addAll
(Collection<? extends K> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
void
int
hashCode()
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) int
size()
Returns a type-specific spliterator on the elements of this collection.Object[]
toArray()
<T> T[]
toArray
(T[] array) Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceCollection
toString
Methods inherited from class java.util.AbstractCollection
add, isEmpty, remove
Methods inherited from interface java.util.Collection
add, isEmpty, parallelStream, remove, stream, toArray
-
Method Details
-
contains
- Specified by:
contains
in interfaceCollection<K>
- Overrides:
contains
in classAbstractCollection<K>
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArray
in interfaceCollection<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
iterator
Description copied from interface:ReferenceCollection
Returns a type-specific iterator on the elements of this collection.- Specified by:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceReferenceCollection<K>
- Specified by:
iterator
in classAbstractReferenceCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:ReferenceCollection
Returns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()
for more documentation on the requirements of the returned spliterator.- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
size
in interfaceCollection<K>
- Specified by:
size
in classAbstractCollection<K>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<K>
- Overrides:
clear
in classAbstractCollection<K>
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<K>
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceCollection<K>
- Overrides:
equals
in classObject
-
forEach
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
- Overrides:
containsAll
in classAbstractCollection<K>
-
addAll
- Specified by:
addAll
in interfaceCollection<K>
- Overrides:
addAll
in classAbstractCollection<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
- Overrides:
removeAll
in classAbstractCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
- Overrides:
retainAll
in classAbstractCollection<K>
-
removeIf
-