You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2016/12/03 18:01:06 UTC

[3/3] mina git commit: Added some missing Javadoc

Added some missing Javadoc

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/756ea427
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/756ea427
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/756ea427

Branch: refs/heads/2.0
Commit: 756ea42708d915726ca8e1d75b11204bac578a27
Parents: c7209e0
Author: Emmanuel L�charny <el...@symas.com>
Authored: Sat Dec 3 18:53:04 2016 +0100
Committer: Emmanuel L�charny <el...@symas.com>
Committed: Sat Dec 3 18:53:04 2016 +0100

----------------------------------------------------------------------
 .../org/apache/mina/util/ConcurrentHashSet.java | 23 ++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/756ea427/mina-core/src/main/java/org/apache/mina/util/ConcurrentHashSet.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/util/ConcurrentHashSet.java b/mina-core/src/main/java/org/apache/mina/util/ConcurrentHashSet.java
index a27e014..6fca915 100644
--- a/mina-core/src/main/java/org/apache/mina/util/ConcurrentHashSet.java
+++ b/mina-core/src/main/java/org/apache/mina/util/ConcurrentHashSet.java
@@ -26,6 +26,8 @@ import java.util.concurrent.ConcurrentMap;
 
 /**
  * A {@link ConcurrentHashMap}-backed {@link Set}.
+ * 
+ * @param <E> The type of the element stored in the set 
  *
  * @author <a href="http://mina.apache.org">Apache MINA Project</a>
  */
@@ -33,17 +35,30 @@ public class ConcurrentHashSet<E> extends MapBackedSet<E> {
 
     private static final long serialVersionUID = 8518578988740277828L;
 
+    /**
+     * Creates a new instance of ConcurrentHashSet
+     */
     public ConcurrentHashSet() {
         super(new ConcurrentHashMap<E, Boolean>());
     }
 
-    public ConcurrentHashSet(Collection<E> c) {
-        super(new ConcurrentHashMap<E, Boolean>(), c);
+    /**
+     * Creates a new instance of ConcurrentHashSet, initialized with 
+     * the content of another collection
+     * 
+     * @param collection The collection to inject in this set
+     */
+    public ConcurrentHashSet(Collection<E> collection) {
+        super(new ConcurrentHashMap<E, Boolean>(), collection);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
-    public boolean add(E o) {
-        Boolean answer = ((ConcurrentMap<E, Boolean>) map).putIfAbsent(o, Boolean.TRUE);
+    public boolean add(E element) {
+        Boolean answer = ((ConcurrentMap<E, Boolean>) map).putIfAbsent(element, Boolean.TRUE);
+        
         return answer == null;
     }
 }