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
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
equals(java.lang.Object o)
int
hashCode()
ObjectBidirectionalIterator<K>
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
-
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectCollection
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:ObjectCollection
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 interfacejava.util.Collection<K>
- Specified by:
iterator
in interfacejava.lang.Iterable<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:
Iterable.iterator()
-
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
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
-