Class BooleanCollections.EmptyCollection
- java.lang.Object
-
- java.util.AbstractCollection<Boolean>
-
- it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
-
- it.unimi.dsi.fastutil.booleans.BooleanCollections.EmptyCollection
-
- All Implemented Interfaces:
BooleanCollection
,BooleanIterable
,Iterable<Boolean>
,Collection<Boolean>
- Direct Known Subclasses:
BooleanBigLists.EmptyBigList
,BooleanLists.EmptyList
,BooleanSets.EmptySet
- Enclosing class:
- BooleanCollections
public abstract static class BooleanCollections.EmptyCollection extends AbstractBooleanCollection
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(BooleanCollection c)
Adds all elements of the given type-specific collection to this collection.boolean
addAll(Collection<? extends Boolean> c)
void
clear()
boolean
contains(boolean k)
Returnstrue
if this collection contains the specified element.boolean
equals(Object o)
int
hashCode()
BooleanBidirectionalIterator
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
removeAll(BooleanCollection c)
Remove from this collection all elements in the given type-specific collection.boolean
removeAll(Collection<?> c)
boolean
retainAll(BooleanCollection c)
Retains in this collection only elements from the given type-specific collection.boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
-
Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
add, add, contains, containsAll, containsAll, rem, remove, toArray, toBooleanArray, toBooleanArray, toString
-
Methods inherited from class java.util.AbstractCollection
isEmpty, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanIterable
forEach, forEach
-
Methods inherited from interface java.util.Collection
isEmpty, parallelStream, removeIf, spliterator, stream, toArray, toArray
-
-
-
-
Method Detail
-
contains
public boolean contains(boolean k)
Description copied from class:AbstractBooleanCollection
Returnstrue
if this collection contains the specified element.This implementation iterates over the elements in the collection, looking for the specified element.
- Specified by:
contains
in interfaceBooleanCollection
- Overrides:
contains
in classAbstractBooleanCollection
- See Also:
Collection.contains(Object)
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<Boolean>
- Overrides:
toArray
in classAbstractCollection<Boolean>
-
iterator
public BooleanBidirectionalIterator iterator()
Description copied from interface:BooleanCollection
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 interfaceBooleanCollection
- Specified by:
iterator
in interfaceBooleanIterable
- Specified by:
iterator
in interfaceCollection<Boolean>
- Specified by:
iterator
in interfaceIterable<Boolean>
- Specified by:
iterator
in classAbstractBooleanCollection
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
size
public int size()
- Specified by:
size
in interfaceCollection<Boolean>
- Specified by:
size
in classAbstractCollection<Boolean>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<Boolean>
- Overrides:
clear
in classAbstractCollection<Boolean>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<Boolean>
- Overrides:
hashCode
in classObject
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<Boolean>
- Overrides:
equals
in classObject
-
addAll
public boolean addAll(Collection<? extends Boolean> c)
Description copied from class:AbstractBooleanCollection
This implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection
.- Specified by:
addAll
in interfaceCollection<Boolean>
- Overrides:
addAll
in classAbstractBooleanCollection
-
removeAll
public boolean removeAll(Collection<?> c)
Description copied from class:AbstractBooleanCollection
This implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection
.- Specified by:
removeAll
in interfaceCollection<Boolean>
- Overrides:
removeAll
in classAbstractBooleanCollection
-
retainAll
public boolean retainAll(Collection<?> c)
Description copied from class:AbstractBooleanCollection
This implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection
.- Specified by:
retainAll
in interfaceCollection<Boolean>
- Overrides:
retainAll
in classAbstractBooleanCollection
-
addAll
public boolean addAll(BooleanCollection c)
Description copied from interface:BooleanCollection
Adds all elements of the given type-specific collection to this collection.- Specified by:
addAll
in interfaceBooleanCollection
- Overrides:
addAll
in classAbstractBooleanCollection
- Parameters:
c
- a type-specific collection.- Returns:
true
if this collection changed as a result of the call.- See Also:
Collection.addAll(Collection)
-
removeAll
public boolean removeAll(BooleanCollection c)
Description copied from interface:BooleanCollection
Remove from this collection all elements in the given type-specific collection.- Specified by:
removeAll
in interfaceBooleanCollection
- Overrides:
removeAll
in classAbstractBooleanCollection
- Parameters:
c
- a type-specific collection.- Returns:
true
if this collection changed as a result of the call.- See Also:
Collection.removeAll(Collection)
-
retainAll
public boolean retainAll(BooleanCollection c)
Description copied from interface:BooleanCollection
Retains in this collection only elements from the given type-specific collection.- Specified by:
retainAll
in interfaceBooleanCollection
- Overrides:
retainAll
in classAbstractBooleanCollection
- Parameters:
c
- a type-specific collection.- Returns:
true
if this collection changed as a result of the call.- See Also:
Collection.retainAll(Collection)
-
-