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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(Collection<? extends K> c)
void
clear()
boolean
contains(Object k)
boolean
equals(Object o)
int
hashCode()
ObjectBidirectionalIterator<K>
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
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:
contains
in interfaceCollection<K>
- Overrides:
contains
in classAbstractCollection<K>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
iterator
public ObjectBidirectionalIterator<K> iterator()
Description copied from interface:ReferenceCollection
Returns 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:
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:
Iterable.iterator()
-
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
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<K>
- Overrides:
equals
in classObject
-
addAll
public boolean addAll(Collection<? extends K> c)
- Specified by:
addAll
in interfaceCollection<K>
- Overrides:
addAll
in classAbstractCollection<K>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<K>
- Overrides:
removeAll
in classAbstractCollection<K>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<K>
- Overrides:
retainAll
in classAbstractCollection<K>
-
-