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 Detail
-
add
public boolean add(K k)
- Specified by:
addin interfaceCollection<K>
-
contains
public boolean contains(Object k)
- Specified by:
containsin interfaceCollection<K>
-
remove
public boolean remove(Object k)
- Specified by:
removein interfaceCollection<K>
-
size
public int size()
- Specified by:
sizein interfaceCollection<K>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<K>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<K>
-
iterator
public ObjectIterator<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
public boolean addAll(Collection<? extends K> c)
- Specified by:
addAllin interfaceCollection<K>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<K>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<K>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<K>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<K>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<K>- Overrides:
hashCodein classObject
-
-