Package it.unimi.dsi.fastutil.objects
Class ReferenceSets.SynchronizedSet<K>
java.lang.Object
it.unimi.dsi.fastutil.objects.ReferenceSets.SynchronizedSet<K>
- All Implemented Interfaces:
ObjectIterable<K>
,ReferenceCollection<K>
,ReferenceSet<K>
,Serializable
,Iterable<K>
,Collection<K>
,Set<K>
- Direct Known Subclasses:
ReferenceSortedSets.SynchronizedSortedSet
- Enclosing class:
ReferenceSets
public static class ReferenceSets.SynchronizedSet<K>
extends Object
implements ReferenceSet<K>, Serializable
A synchronized wrapper class for sets.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends K> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
void
int
hashCode()
boolean
isEmpty()
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) int
size()
Returns a type-specific spliterator on the elements of this collection.stream()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface it.unimi.dsi.fastutil.objects.ReferenceSet
iterator, spliterator
-
Method Details
-
remove
-
add
- Specified by:
add
in interfaceCollection<K>
-
contains
- Specified by:
contains
in interfaceCollection<K>
-
size
public int size()- Specified by:
size
in interfaceCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<K>
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<K>
-
iterator
Description copied from interface:ReferenceCollection
Returns a type-specific iterator on the elements of this collection.- Specified by:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceReferenceCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:ReferenceCollection
Returns 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:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceObjectIterable<K>
- Specified by:
spliterator
in interfaceReferenceCollection<K>
- Returns:
- a type-specific spliterator on the elements of this collection.
-
stream
- Specified by:
stream
in interfaceCollection<K>
-
parallelStream
- Specified by:
parallelStream
in interfaceCollection<K>
-
forEach
-
addAll
- Specified by:
addAll
in interfaceCollection<K>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<K>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<K>
-
toString
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<K>
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceCollection<K>
- Overrides:
equals
in classObject
-