Package it.unimi.dsi.fastutil.objects
Class ObjectCollections.SynchronizedCollection<K>
java.lang.Object
it.unimi.dsi.fastutil.objects.ObjectCollections.SynchronizedCollection<K>
- All Implemented Interfaces:
ObjectCollection<K>,ObjectIterable<K>,Serializable,Iterable<K>,Collection<K>
- Direct Known Subclasses:
ObjectBigLists.SynchronizedBigList,ObjectLists.SynchronizedList,ObjectSets.SynchronizedSet
- Enclosing class:
- ObjectCollections
public static class ObjectCollections.SynchronizedCollection<K> extends Object implements ObjectCollection<K>, Serializable
A synchronized wrapper class for collections.
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description booleanadd(K k)booleanaddAll(Collection<? extends K> c)voidclear()booleancontains(Object k)booleancontainsAll(Collection<?> c)booleanequals(Object o)inthashCode()booleanisEmpty()ObjectIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(Object k)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
add
- Specified by:
addin interfaceCollection<K>
-
contains
- Specified by:
containsin interfaceCollection<K>
-
remove
- Specified by:
removein interfaceCollection<K>
-
size
public int size()- Specified by:
sizein interfaceCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<K>
-
toArray
- Specified by:
toArrayin interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a)- Specified by:
toArrayin interfaceCollection<K>
-
iterator
Description copied from interface:ObjectCollectionReturns 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 interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
addAll
- Specified by:
addAllin interfaceCollection<K>
-
containsAll
- Specified by:
containsAllin interfaceCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<K>
-
toString
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<K>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<K>- Overrides:
equalsin classObject
-