Class BooleanCollections.SynchronizedCollection
- java.lang.Object
-
- it.unimi.dsi.fastutil.booleans.BooleanCollections.SynchronizedCollection
-
- All Implemented Interfaces:
BooleanCollection,BooleanIterable,Serializable,Iterable<Boolean>,Collection<Boolean>
- Direct Known Subclasses:
BooleanBigLists.SynchronizedBigList,BooleanLists.SynchronizedList,BooleanSets.SynchronizedSet
- Enclosing class:
- BooleanCollections
public static class BooleanCollections.SynchronizedCollection extends Object implements BooleanCollection, Serializable
A synchronized wrapper class for collections.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(boolean k)Ensures that this collection contains the specified element (optional operation).booleanadd(Boolean k)Deprecated.booleanaddAll(BooleanCollection c)Adds 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.booleancontains(Object k)Deprecated.booleancontainsAll(BooleanCollection c)Checks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c)booleanequals(Object o)inthashCode()booleanisEmpty()BooleanIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanrem(boolean k)Removes a single instance of the specified element from this collection, if it is present (optional operation).booleanremove(Object k)Deprecated.booleanremoveAll(BooleanCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)booleanretainAll(BooleanCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c)intsize()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[]toBooleanArray()Returns a primitive type array containing the items of this collection.boolean[]toBooleanArray(boolean[] a)Deprecated.StringtoString()-
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanIterable
forEach, forEach
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
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:
Collection.add(Object)
-
contains
public boolean contains(boolean k)
Description copied from interface:BooleanCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceBooleanCollection- See Also:
Collection.contains(Object)
-
rem
public boolean rem(boolean k)
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- See Also:
Collection.remove(Object)
-
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:
Collection.toArray()
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<Boolean>
-
toBooleanArray
@Deprecated public boolean[] toBooleanArray(boolean[] a)
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:
Collection.toArray(Object[])
-
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:
Collection.toArray(Object[])
-
addAll
public boolean addAll(BooleanCollection c)
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:
Collection.addAll(Collection)
-
containsAll
public boolean containsAll(BooleanCollection c)
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:
Collection.containsAll(Collection)
-
removeAll
public boolean removeAll(BooleanCollection c)
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:
Collection.removeAll(Collection)
-
retainAll
public boolean retainAll(BooleanCollection c)
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:
Collection.retainAll(Collection)
-
add
@Deprecated public boolean add(Boolean k)
Deprecated.Description copied from interface:BooleanCollection- Specified by:
addin interfaceBooleanCollection- Specified by:
addin interfaceCollection<Boolean>
-
contains
@Deprecated public boolean contains(Object k)
Deprecated.Description copied from interface:BooleanCollection- Specified by:
containsin interfaceBooleanCollection- Specified by:
containsin interfaceCollection<Boolean>
-
remove
@Deprecated public boolean remove(Object k)
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
public BooleanIterator iterator()
Description copied from interface:BooleanCollectionReturns 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:
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:
Iterable.iterator()
-
addAll
public boolean addAll(Collection<? extends Boolean> c)
- Specified by:
addAllin interfaceCollection<Boolean>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Boolean>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Boolean>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<Boolean>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<Boolean>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<Boolean>- Overrides:
hashCodein classObject
-
-