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 2005/05/21 23:12:55 UTC

svn commit: r171256 - in /jakarta/commons/proper/collections/trunk: RELEASE-NOTES.html src/java/org/apache/commons/collections/MapUtils.java

Author: scolebourne
Date: Sat May 21 14:12:54 2005
New Revision: 171256

URL: http://svn.apache.org/viewcvs?rev=171256&view=rev
Log:
Add MultiValueMap providing control over the map and collection implementations
29440

Modified:
    jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html
    jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/MapUtils.java

Modified: jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html?rev=171256&r1=171255&r2=171256&view=diff
==============================================================================
--- jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html (original)
+++ jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html Sat May 21 14:12:54 2005
@@ -42,6 +42,7 @@
 
 <center><h3>NEW CLASSES</h3></center>
 <ul>
+<li>MultiValueMap - Decorator implementation of MultiMap providing control over the map and collection implementations [29440]</li>
 <li>DefaultedMap - Returns a default value when the key is not found, without adding the default value to the map itself [30911]</li>
 <li>GrowthList - Decorator that causes set and indexed add to expand the list rather than throw IndexOutOfBoundsException [34171]</li>
 <li>LoopingListIterator - When the end of the list is reached the iteration continues from the start [30166]</li>

Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/MapUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/MapUtils.java?rev=171256&r1=171255&r2=171256&view=diff
==============================================================================
--- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/MapUtils.java (original)
+++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/MapUtils.java Sat May 21 14:12:54 2005
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2004 The Apache Software Foundation
+ *  Copyright 2001-2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -1377,7 +1377,50 @@
     public static Map orderedMap(Map map) {
         return ListOrderedMap.decorate(map);
     }
-    
+
+    /**
+     * Creates a mult-value map backed by the given map which returns
+     * collections of type ArrayList.
+     *
+     * @param map  the map to decorate
+     * @return a multi-value map backed by the given map which returns ArrayLists of values.
+     * @see MultiValueMap
+     * @since Commons Collections 3.2
+     */
+    public static Map multiValueMap(Map map) {
+        return MultiValueMap.decorate(map);
+    }
+
+    /**
+     * Creates a multi-value map backed by the given map which returns
+     * collections of the specified type.
+     *
+     * @param map  the map to decorate
+     * @param collectionClass  the type of collections to return from the map (must contain public no-arg constructor
+     *  and extend Collection).
+     * @return a multi-value map backed by the given map which returns collections of the specified type
+     * @see MultiValueMap
+     * @since Commons Collections 3.2
+     */
+    public static Map multiValueMap(Map map, Class collectionClass) {
+        return MultiValueMap.decorate(map, collectionClass);
+    }
+
+    /**
+     * Creates a multi-value map backed by the given map which returns
+     * collections created by the specified collection factory.
+     *
+     * @param map  the map to decorate
+     * @param collectionFactory  a factor which creates collection objects
+     * @return a multi-value map backed by the given map which returns collections
+     * created by the specified collection factory
+     * @see MultiValueMap
+     * @since Commons Collections 3.2
+     */
+    public static Map multiValueMap(Map map, Factory collectionFactory) {
+        return MultiValueMap.decorate(map, collectionFactory);
+    }
+
     // SortedMap decorators
     //-----------------------------------------------------------------------
     /**
@@ -1555,47 +1598,5 @@
     public static SortedMap lazySortedMap(SortedMap map, Transformer transformerFactory) {
         return LazySortedMap.decorate(map, transformerFactory);
     }
-
-    /**
-     * Creates a mult-value map backed by the given map which returns ArrayLists.
-     * @param map the map to decorate
-     * @return a multi-value map backed by the given map which returns ArrayLists of values.
-     * @see MultiValueMap
-     * @since Commons Collections 3.2
-     */
-    public static Map multiValueMap( Map map ) {
-        return MultiValueMap.decorate( map );
-    }
-
-    /**
-     * Creates a multi-value map backed by the given map which returns collections of
-     * the specified type.
-     * @param map the map to decorate
-     * @param collectionClass the type of collections to return from the map (must contain public no-arg constructor
-     * and extend Collection).
-     * @return a multi-value map backed by the given map which returns collections of the specified type
-     * @see MultiValueMap
-     * @since Commons Collections 3.2
-     */
-    public static Map multiValueMap( Map map, Class collectionClass ) {
-        return MultiValueMap.decorate( map, collectionClass );
-    }
-
-    /**
-     * Creates a multi-value map backed by the given map which returns collections
-     * created by the specified collection factory.
-     * @param map the map to decorate
-     * @param collectionFactory a factor which creates collection objects
-     * @return a multi-value map backed by the given map which returns collections
-     * created by the specified collection factory
-     * @see MultiValueMap
-     * @since Commons Collections 3.2
-     */
-    public static Map multiValueMap( Map map, Factory collectionFactory ) {
-        return MultiValueMap.decorate( map, collectionFactory );
-    }
-
-
-
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org