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>,java.lang.Iterable<K>,java.util.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 Type Method Description booleanaddAll(java.util.Collection<? extends K> c)voidclear()booleancontains(java.lang.Object k)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)voidforEach(java.util.function.Consumer<? super K> action)inthashCode()ObjectBidirectionalIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremoveAll(java.util.Collection<?> c)booleanremoveIf(java.util.function.Predicate<? super K> filter)booleanretainAll(java.util.Collection<?> c)intsize()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.AbstractObjectCollection
toStringMethods inherited from class java.util.AbstractCollection
add, isEmpty, removeMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
add, isEmpty, parallelStream, remove, stream, toArray
-
Method Details
-
contains
public boolean contains(java.lang.Object k) -
toArray
public java.lang.Object[] toArray() -
toArray
public <T> T[] toArray(T[] array) -
iterator
Description copied from interface:ObjectCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfacejava.util.Collection<K>- Specified by:
iteratorin interfacejava.lang.Iterable<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Specified by:
iteratorin classAbstractObjectCollection<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
spliterator
Description copied from interface:ObjectCollectionReturns 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:
hashCodein interfacejava.util.Collection<K>- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Specified by:
equalsin interfacejava.util.Collection<K>- Overrides:
equalsin classjava.lang.Object
-
forEach
-
containsAll
public boolean containsAll(java.util.Collection<?> c) -
addAll
-
removeAll
public boolean removeAll(java.util.Collection<?> c) -
retainAll
public boolean retainAll(java.util.Collection<?> c) -
removeIf
-