Package it.unimi.dsi.fastutil.booleans
Class AbstractBooleanSet
java.lang.Object
java.util.AbstractCollection<Boolean>
it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
it.unimi.dsi.fastutil.booleans.AbstractBooleanSet
- All Implemented Interfaces:
BooleanCollection
,BooleanIterable
,BooleanSet
,Cloneable
,Iterable<Boolean>
,Collection<Boolean>
,Set<Boolean>
- Direct Known Subclasses:
BooleanArraySet
,BooleanOpenHashSet
,BooleanSets.Singleton
public abstract class AbstractBooleanSet
extends AbstractBooleanCollection
implements Cloneable, BooleanSet
An abstract class providing basic methods for sets implementing a type-specific interface.
Note that the type-specific Set
interface adds a type-specific remove()
method,
as it is no longer harmful for subclasses. Thus, concrete subclasses of this class must implement
remove()
(the rem()
implementation of this class just delegates to
remove()
).
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
Returns a hash code for this set.abstract BooleanIterator
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
rem
(boolean k) Deprecated.boolean
remove
(boolean k) Removes an element from this set.Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
add, add, addAll, addAll, contains, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toArray, toBooleanArray, toBooleanArray, toString
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toBooleanArray, toBooleanArray
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanIterable
forEach, forEach
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanSet
add, contains, remove, spliterator
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Method Details
-
iterator
Description copied from interface:BooleanCollection
Returns a type-specific iterator on the elements of this collection.- Specified by:
iterator
in interfaceBooleanCollection
- Specified by:
iterator
in interfaceBooleanIterable
- Specified by:
iterator
in interfaceBooleanSet
- Specified by:
iterator
in interfaceCollection<Boolean>
- Specified by:
iterator
in interfaceIterable<Boolean>
- Specified by:
iterator
in interfaceSet<Boolean>
- Specified by:
iterator
in classAbstractBooleanCollection
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
equals
-
hashCode
public int hashCode()Returns a hash code for this set. The hash code of a set is computed by summing the hash codes of its elements. -
remove
public boolean remove(boolean k) Removes an element from this set. Delegates to the type-specificrem()
method implemented by type-specific abstractCollection
superclass.- Specified by:
remove
in interfaceBooleanSet
- See Also:
-
rem
Deprecated.Please useremove()
instead.Removes a single instance of the specified element from this collection, if it is present (optional operation).Note that this method should be called
remove()
, but the clash with the similarly named index-based method in theList
interface forces us to use a distinguished name. For simplicity, the set interfaces reinstatesremove()
. Delegates to the type-specificremove()
method specified in the type-specificSet
interface.- Specified by:
rem
in interfaceBooleanCollection
- Specified by:
rem
in interfaceBooleanSet
- Overrides:
rem
in classAbstractBooleanCollection
- See Also:
-
remove()
instead.