Package it.unimi.dsi.fastutil.booleans
Class AbstractBooleanSet
- java.lang.Object
-
- java.util.AbstractCollection<java.lang.Boolean>
-
- it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
-
- it.unimi.dsi.fastutil.booleans.AbstractBooleanSet
-
- All Implemented Interfaces:
BooleanCollection
,BooleanIterable
,BooleanSet
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Boolean>
,java.util.Collection<java.lang.Boolean>
,java.util.Set<java.lang.Boolean>
- Direct Known Subclasses:
BooleanArraySet
,BooleanOpenHashSet
,BooleanSets.Singleton
public abstract class AbstractBooleanSet extends AbstractBooleanCollection implements java.lang.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-specificremove()
method, as it is no longer harmful for subclasses. Thus, concrete subclasses of this class must implementremove()
(therem()
implementation of this class just delegates toremove()
).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
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.Please useremove()
instead.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
-
-
-
-
Method Detail
-
iterator
public abstract BooleanIterator 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 interfacejava.util.Collection<java.lang.Boolean>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Boolean>
- Specified by:
iterator
in interfacejava.util.Set<java.lang.Boolean>
- Specified by:
iterator
in classAbstractBooleanCollection
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<java.lang.Boolean>
- Specified by:
equals
in interfacejava.util.Set<java.lang.Boolean>
- Overrides:
equals
in classjava.lang.Object
-
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.- Specified by:
hashCode
in interfacejava.util.Collection<java.lang.Boolean>
- Specified by:
hashCode
in interfacejava.util.Set<java.lang.Boolean>
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code for this set.
-
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:
Collection.remove(Object)
-
rem
@Deprecated public boolean rem(boolean k)
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:
Collection.remove(Object)
-
-