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>
,java.lang.Iterable<K>
,java.util.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(java.util.Collection<? extends K> c)
void
clear()
boolean
contains(java.lang.Object k)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super K> action)
int
hashCode()
ObjectBidirectionalIterator<K>
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
removeAll(java.util.Collection<?> c)
boolean
removeIf(java.util.function.Predicate<? super K> filter)
boolean
retainAll(java.util.Collection<?> c)
int
size()
ObjectSpliterator<K>
spliterator()
Returns a type-specific spliterator on the elements of this collection.java.lang.Object[]
toArray()
<T> T[]
toArray(T[] array)
-
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceCollection
toString
-
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.Object k)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
iterator
public ObjectBidirectionalIterator<K> iterator()
Description copied from interface:ReferenceCollection
Returns a type-specific iterator on the elements of this collection.- Specified by:
iterator
in interfacejava.util.Collection<K>
- Specified by:
iterator
in interfacejava.lang.Iterable<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()
-
spliterator
public ObjectSpliterator<K> 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()
-
clear
public void clear()
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<K>
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<K>
- Overrides:
equals
in classjava.lang.Object
-
forEach
public void forEach(java.util.function.Consumer<? super K> action)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super K> filter)
-
-