You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2002/10/13 00:05:00 UTC

cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections MultiHashMap.java

scolebourne    2002/10/12 15:04:59

  Modified:    collections/src/java/org/apache/commons/collections
                        MultiHashMap.java
  Log:
  Removed unused variable (patch from Steve Downey)
  Added class level javadoc
  
  Revision  Changes    Path
  1.5       +15 -8     jakarta-commons/collections/src/java/org/apache/commons/collections/MultiHashMap.java
  
  Index: MultiHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/MultiHashMap.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MultiHashMap.java	12 Jun 2002 03:59:15 -0000	1.4
  +++ MultiHashMap.java	12 Oct 2002 22:04:59 -0000	1.5
  @@ -62,13 +62,20 @@
   
   import java.util.*;
   import java.io.*;
  -
  -/** see MultiMap for details of an important semantic difference
  - * between this and a typical HashMap
  +/** 
  + * <code>MultiHashMap</code> is the default implementation of the 
  + * {@link MultiMap} interface. A <code>MultiMap</code> is a Map
  + * with slightly different semantics.
  + * Instead of returning an Object, it returns a Collection.
  + * So for example, you can put( key, new Integer(1) ); 
  + * and then a Object get( key ); will return you a Collection 
  + * instead of an Integer.
    *
    * @since 2.0
    * @author Christopher Berry
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  + * @author Steve Downey
  + * @author Stephen Colebourne
    */
   public class MultiHashMap extends HashMap implements MultiMap
   {
  @@ -186,8 +193,8 @@
               ArrayList list = (ArrayList)(keyValuePair.getValue());
               
               Object[] values = list.toArray();
  -            for( int ii=0; ii < values.length; ii++ ) {
  -                boolean successfulAdd = returnList.add( values[ii] );
  +            for ( int ii=0; ii < values.length; ii++ ) {
  +                returnList.add( values[ii] );
               }
           }
           return returnList;
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>