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 booleanaddAll(java.util.Collection<? extends K> c)voidclear()booleancontains(java.lang.Object k)booleanequals(java.lang.Object o)inthashCode()ObjectBidirectionalIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.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
-
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.Object k)
-
toArray
public java.lang.Object[] toArray()
-
iterator
public ObjectBidirectionalIterator<K> iterator()
Description copied from interface:ReferenceCollectionReturns 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:
iteratorin interfacejava.util.Collection<K>- Specified by:
iteratorin interfacejava.lang.Iterable<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Specified by:
iteratorin interfaceReferenceCollection<K>- Specified by:
iteratorin classAbstractReferenceCollection<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
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
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
-