Package com.cedarsoftware.util
Class ConcurrentSet<T>
java.lang.Object
com.cedarsoftware.util.ConcurrentSet<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Set<T>
ConcurrentSet provides a Set that is thread-safe, usable in highly concurrent environments. It provides
a no-arg constructor that will directly return a ConcurrentSet that is thread-safe. It has a constructor
that takes a Collection argument and populates its internal Concurrent Set delegate implementation.
- Author:
- John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
License
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new empty ConcurrentSet.ConcurrentSet
(Collection<T> col) Create a new ConcurrentSet instance with data from the passed in Collection. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T1> T1[]
toArray
(T1[] a) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
ConcurrentSet
public ConcurrentSet()Create a new empty ConcurrentSet. -
ConcurrentSet
Create a new ConcurrentSet instance with data from the passed in Collection. This data is populated into the internal set.- Parameters:
col
-
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
isEmpty
public boolean isEmpty() -
size
public int size() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceSet<T>
-
iterator
-
toArray
-
toArray
public <T1> T1[] toArray(T1[] a) -
add
-
addAll
-
remove
-
removeAll
-
retainAll
-
clear
public void clear()
-