Package it.unimi.dsi.fastutil.booleans
Class BooleanSets.SynchronizedSet
java.lang.Object
it.unimi.dsi.fastutil.booleans.BooleanSets.SynchronizedSet
- All Implemented Interfaces:
BooleanCollection,BooleanIterable,BooleanSet,Serializable,Iterable<Boolean>,Collection<Boolean>,Set<Boolean>
- Enclosing class:
BooleanSets
A synchronized wrapper class for sets.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(boolean k) Ensures that this collection contains the specified element (optional operation).booleanDeprecated.booleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Boolean> c) voidclear()booleancontains(boolean k) Returnstrueif this collection contains the specified element.booleanDeprecated.booleanChecks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c) booleanvoidforEach(BooleanConsumer action) Performs the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.inthashCode()booleanisEmpty()iterator()Returns a type-specific iterator on the elements of this collection.booleanrem(boolean k) Deprecated.booleanremove(boolean k) Removes an element from this set.booleanDeprecated.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(BooleanPredicate filter) Remove from this collection all elements which satisfy the given predicate.booleanRetains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c) intsize()Returns a type-specific spliterator on the elements of this collection.stream()Object[]toArray()boolean[]toArray(boolean[] a) Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.<T> T[]toArray(T[] a) boolean[]Returns a primitive type array containing the items of this collection.boolean[]toBooleanArray(boolean[] a) Deprecated.toString()Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toBooleanArray, toBooleanArrayMethods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanIterable
forEach, forEachMethods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanSet
add, contains, iterator, remove, spliteratorMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Method Details
-
remove
public boolean remove(boolean k) Description copied from interface:BooleanSetRemoves an element from this set.- Specified by:
removein interfaceBooleanSet- See Also:
-
rem
Deprecated.Description copied from interface:BooleanCollectionRemoves 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 theListinterface forces us to use a distinguished name. For simplicity, the set interfaces reinstatesremove().- Specified by:
remin interfaceBooleanCollection- Specified by:
remin interfaceBooleanSet- See Also:
-
add
public boolean add(boolean k) Description copied from interface:BooleanCollectionEnsures that this collection contains the specified element (optional operation).- Specified by:
addin interfaceBooleanCollection- See Also:
-
contains
public boolean contains(boolean k) Description copied from interface:BooleanCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceBooleanCollection- See Also:
-
size
public int size()- Specified by:
sizein interfaceCollection<Boolean>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Boolean>
-
toBooleanArray
public boolean[] toBooleanArray()Description copied from interface:BooleanCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toBooleanArrayin interfaceBooleanCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
toArray
- Specified by:
toArrayin interfaceCollection<Boolean>
-
toBooleanArray
Deprecated.Description copied from interface:BooleanCollectionReturns a primitive type array containing the items of this collection.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toBooleanArrayin interfaceBooleanCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
toArray
public boolean[] toArray(boolean[] a) Description copied from interface:BooleanCollectionReturns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toArrayin interfaceBooleanCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
addAll
Description copied from interface:BooleanCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
containsAll
Description copied from interface:BooleanCollectionChecks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.- See Also:
-
removeAll
Description copied from interface:BooleanCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
retainAll
Description copied from interface:BooleanCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
add
Deprecated.Description copied from interface:BooleanCollection- Specified by:
addin interfaceBooleanCollection- Specified by:
addin interfaceCollection<Boolean>
-
contains
Deprecated.Description copied from interface:BooleanCollection- Specified by:
containsin interfaceBooleanCollection- Specified by:
containsin interfaceCollection<Boolean>
-
remove
Deprecated.Description copied from interface:BooleanCollection- Specified by:
removein interfaceBooleanCollection- Specified by:
removein interfaceCollection<Boolean>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<Boolean>
-
iterator
Description copied from interface:BooleanCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceBooleanCollection- Specified by:
iteratorin interfaceBooleanIterable- Specified by:
iteratorin interfaceCollection<Boolean>- Specified by:
iteratorin interfaceIterable<Boolean>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:BooleanCollectionReturns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceBooleanCollection- Specified by:
spliteratorin interfaceBooleanIterable- Specified by:
spliteratorin interfaceCollection<Boolean>- Specified by:
spliteratorin interfaceIterable<Boolean>- Returns:
- a type-specific spliterator on the elements of this collection.
-
stream
- Specified by:
streamin interfaceCollection<Boolean>
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<Boolean>
-
forEach
Description copied from interface:BooleanIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceBooleanIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
addAll
- Specified by:
addAllin interfaceCollection<Boolean>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Boolean>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Boolean>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Boolean>
-
removeIf
Description copied from interface:BooleanCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceBooleanCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Boolean>
-
toString
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Boolean>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<Boolean>- Overrides:
equalsin classObject
-