From f6892d8d79eb0f65a8c2d0d777dc980e0da4e73b Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Mon, 29 Apr 2024 01:52:32 -0400 Subject: [PATCH] updated comments --- .../java/com/cedarsoftware/util/ConcurrentSet.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/cedarsoftware/util/ConcurrentSet.java b/src/main/java/com/cedarsoftware/util/ConcurrentSet.java index 81e7903e..722d9498 100644 --- a/src/main/java/com/cedarsoftware/util/ConcurrentSet.java +++ b/src/main/java/com/cedarsoftware/util/ConcurrentSet.java @@ -6,6 +6,10 @@ import java.util.concurrent.ConcurrentHashMap; /** + * 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 (jdereg@gmail.com) *
* Copyright (c) Cedar Software LLC @@ -25,10 +29,18 @@ public class ConcurrentSet implements Set { private final Set set; + /** + * Create a new empty ConcurrentSet. + */ public ConcurrentSet() { set = ConcurrentHashMap.newKeySet(); } + /** + * Create a new ConcurrentSet instance with data from the passed in Collection. This data is populated into the + * internal set. + * @param col + */ public ConcurrentSet(Collection col) { set = ConcurrentHashMap.newKeySet(col.size()); set.addAll(col);