Package it.unimi.dsi.fastutil.booleans
Class BooleanSets.Singleton
java.lang.Object
java.util.AbstractCollection<Boolean>
it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
it.unimi.dsi.fastutil.booleans.AbstractBooleanSet
it.unimi.dsi.fastutil.booleans.BooleanSets.Singleton
- All Implemented Interfaces:
BooleanCollection
,BooleanIterable
,BooleanSet
,Serializable
,Cloneable
,Iterable<Boolean>
,Collection<Boolean>
,Set<Boolean>
- Enclosing class:
BooleanSets
public static class BooleanSets.Singleton
extends AbstractBooleanSet
implements Serializable, Cloneable
An immutable class representing a type-specific singleton set.
This class may be useful to implement your own in case you subclass a type-specific set.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds all elements of the given type-specific collection to this collection.boolean
addAll
(Collection<? extends Boolean> c) clone()
boolean
contains
(boolean k) Returnstrue
if this collection contains the specified element.void
forEach
(BooleanConsumer action) Performs the given action for each element of this type-specificIterable
until all elements have been processed or the action throws an exception.void
Deprecated.iterator()
Returns a type-specific iterator on the elements of this collection.boolean
remove
(boolean k) Removes an element from this set.boolean
Remove from this collection all elements in the given type-specific collection.boolean
removeAll
(Collection<?> c) boolean
removeIf
(BooleanPredicate filter) Remove from this collection all elements which satisfy the given predicate.boolean
Deprecated.boolean
Retains in this collection only elements from the given type-specific collection.boolean
retainAll
(Collection<?> c) int
size()
Returns a type-specific spliterator on the elements of this set.Object[]
toArray()
Deprecated.boolean[]
Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanSet
equals, hashCode, rem
Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
add, add, contains, containsAll, containsAll, remove, toArray, toBooleanArray, toString
Methods inherited from class java.util.AbstractCollection
clear, isEmpty, toArray
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection
add, containsAll, toArray, toBooleanArray
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanSet
add, contains, remove
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Method Details
-
contains
public boolean contains(boolean k) Description copied from class:AbstractBooleanCollection
Returnstrue
if this collection contains the specified element.- Specified by:
contains
in interfaceBooleanCollection
- Overrides:
contains
in classAbstractBooleanCollection
- See Also:
-
remove
public boolean remove(boolean k) Description copied from class:AbstractBooleanSet
Removes an element from this set. Delegates to the type-specificrem()
method implemented by type-specific abstractCollection
superclass.- Specified by:
remove
in interfaceBooleanSet
- Overrides:
remove
in classAbstractBooleanSet
- See Also:
-
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 classAbstractBooleanSet
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:BooleanSet
Returns a type-specific spliterator on the elements of this set.Set spliterators must report at least
Spliterator.DISTINCT
.See
Set.spliterator()
for more documentation on the requirements of the returned spliterator.- Specified by:
spliterator
in interfaceBooleanCollection
- Specified by:
spliterator
in interfaceBooleanIterable
- Specified by:
spliterator
in interfaceBooleanSet
- Specified by:
spliterator
in interfaceCollection<Boolean>
- Specified by:
spliterator
in interfaceIterable<Boolean>
- Specified by:
spliterator
in interfaceSet<Boolean>
- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
size
in interfaceCollection<Boolean>
- Specified by:
size
in interfaceSet<Boolean>
- Specified by:
size
in classAbstractCollection<Boolean>
-
toBooleanArray
public boolean[] toBooleanArray()Description copied from interface:BooleanCollection
Returns a primitive type array containing the items of this collection.- Specified by:
toBooleanArray
in interfaceBooleanCollection
- Overrides:
toBooleanArray
in classAbstractBooleanCollection
- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:BooleanIterable
- Specified by:
forEach
in interfaceBooleanIterable
- Specified by:
forEach
in interfaceIterable<Boolean>
-
addAll
Description copied from class:AbstractBooleanCollection
- Specified by:
addAll
in interfaceCollection<Boolean>
- Specified by:
addAll
in interfaceSet<Boolean>
- Overrides:
addAll
in classAbstractBooleanCollection
-
removeAll
Description copied from class:AbstractBooleanCollection
- Specified by:
removeAll
in interfaceCollection<Boolean>
- Specified by:
removeAll
in interfaceSet<Boolean>
- Overrides:
removeAll
in classAbstractBooleanCollection
-
retainAll
Description copied from class:AbstractBooleanCollection
- Specified by:
retainAll
in interfaceCollection<Boolean>
- Specified by:
retainAll
in interfaceSet<Boolean>
- Overrides:
retainAll
in classAbstractBooleanCollection
-
removeIf
Deprecated.Description copied from interface:BooleanCollection
- Specified by:
removeIf
in interfaceBooleanCollection
- Specified by:
removeIf
in interfaceCollection<Boolean>
-
forEach
Description copied from interface:BooleanIterable
Performs the given action for each element of this type-specificIterable
until all elements have been processed or the action throws an exception.- Specified by:
forEach
in interfaceBooleanIterable
- Parameters:
action
- the action to be performed for each element.- See Also:
-
addAll
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:
-
removeAll
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:
-
retainAll
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:
-
removeIf
Description copied from interface:BooleanCollection
Remove from this collection all elements which satisfy the given predicate.- Specified by:
removeIf
in interfaceBooleanCollection
- Parameters:
filter
- a predicate which returnstrue
for elements to be removed.- Returns:
true
if any elements were removed.- See Also:
-
toArray
Deprecated.- Specified by:
toArray
in interfaceCollection<Boolean>
- Specified by:
toArray
in interfaceSet<Boolean>
- Overrides:
toArray
in classAbstractCollection<Boolean>
-
clone
-