Package it.unimi.dsi.fastutil.objects
Class ObjectCollections.EmptyCollection<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<K>
it.unimi.dsi.fastutil.objects.ObjectCollections.EmptyCollection<K>
- All Implemented Interfaces:
ObjectCollection<K>
,ObjectIterable<K>
,Iterable<K>
,Collection<K>
- Direct Known Subclasses:
ObjectBigLists.EmptyBigList
,ObjectLists.EmptyList
,ObjectSets.EmptySet
- Enclosing class:
ObjectCollections
public abstract static class ObjectCollections.EmptyCollection<K>
extends AbstractObjectCollection<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.AbstractObjectCollection
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:ObjectCollection
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 interfaceObjectCollection<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in classAbstractObjectCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:ObjectCollection
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
-