directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject svn commit: r471607 - /directory/branches/mina/1.2/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
Date Mon, 06 Nov 2006 01:55:58 GMT
Author: proyal
Date: Sun Nov  5 17:55:57 2006
New Revision: 471607

URL: http://svn.apache.org/viewvc?view=rev&rev=471607
Log:
add generics

Modified:
    directory/branches/mina/1.2/core/src/main/java/org/apache/mina/util/IdentityHashSet.java

Modified: directory/branches/mina/1.2/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.2/core/src/main/java/org/apache/mina/util/IdentityHashSet.java?view=diff&rev=471607&r1=471606&r2=471607
==============================================================================
--- directory/branches/mina/1.2/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
(original)
+++ directory/branches/mina/1.2/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
Sun Nov  5 17:55:57 2006
@@ -6,16 +6,16 @@
  *  to you 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
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.mina.util;
 
@@ -32,44 +32,52 @@
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public class IdentityHashSet extends AbstractSet
+public class IdentityHashSet<E> extends AbstractSet<E>
 {
-    private final Map delegate = new IdentityHashMap();
+    private final Map<E,Boolean> delegate = new IdentityHashMap<E,Boolean>();
 
     public IdentityHashSet()
     {
     }
-    
-    public IdentityHashSet( Collection c )
+
+    public IdentityHashSet( Collection<E> c )
     {
         addAll( c );
     }
 
+    @Override
     public int size()
     {
         return delegate.size();
     }
 
+    @Override
     public boolean contains( Object o )
     {
+        //noinspection SuspiciousMethodCalls
         return delegate.containsKey( o );
     }
 
-    public Iterator iterator()
+    @Override
+    public Iterator<E> iterator()
     {
         return delegate.keySet().iterator();
     }
 
-    public boolean add( Object arg0 )
+    @Override
+    public boolean add( E arg0 )
     {
         return delegate.put( arg0, Boolean.TRUE ) == null;
     }
 
+    @Override
     public boolean remove( Object o )
     {
+        //noinspection SuspiciousMethodCalls
         return delegate.remove( o ) != null;
     }
 
+    @Override
     public void clear()
     {
         delegate.clear();



Mime
View raw message