com.ebay.carad.os.vitalsigns.util
Class CollectionUtil
java.lang.Object
com.ebay.carad.os.vitalsigns.util.CollectionUtil
public final class CollectionUtil
- extends java.lang.Object
Utility class for manipulating collections.
- Version:
- $Id$
- Author:
- Jeremy Kraybill, Jeremy Thomerson
Field Summary |
static org.apache.commons.collections.Transformer |
TO_INTEGER_TRANSFORM
Transformer to convert objects' string representations to integers. |
Method Summary |
static int |
compareSets(java.util.Collection set1,
java.util.Collection set2)
|
static int |
compareSets(java.util.Collection set1,
java.util.Collection set2,
java.util.Comparator comparator)
|
static java.util.Map |
convertKeysToIntegers(java.util.Map inMap)
Converts the keys of a map to integers and creates a new map with
these new keys and the original values. |
static java.util.List |
listOfLists(int containedLists)
Returns a list contain N lists. |
static void |
sortMultiMapLists(org.apache.commons.collections.MultiHashMap map,
java.util.Comparator comparator)
|
static java.lang.String |
toString(java.util.Collection coll)
Concatinates the elements of the collection into a single string. |
static org.apache.commons.collections.MultiMap |
unmodifiableMultiMap(org.apache.commons.collections.MultiMap map)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TO_INTEGER_TRANSFORM
public static final org.apache.commons.collections.Transformer TO_INTEGER_TRANSFORM
- Transformer to convert objects' string representations to integers.
CollectionUtil
private CollectionUtil()
listOfLists
public static java.util.List listOfLists(int containedLists)
- Returns a list contain N lists.
- Parameters:
containedLists
- number of lists to contain.
- Returns:
- The list that contains containedLists lists.
convertKeysToIntegers
public static java.util.Map convertKeysToIntegers(java.util.Map inMap)
- Converts the keys of a map to integers and creates a new map with
these new keys and the original values.
- Parameters:
inMap
-
- Returns:
- Non-null
sortMultiMapLists
public static void sortMultiMapLists(org.apache.commons.collections.MultiHashMap map,
java.util.Comparator comparator)
unmodifiableMultiMap
public static org.apache.commons.collections.MultiMap unmodifiableMultiMap(org.apache.commons.collections.MultiMap map)
toString
public static java.lang.String toString(java.util.Collection coll)
- Concatinates the elements of the collection into a single string. Uses each element's "toString" method, and adds a ", " between
elements. This method is mostly intended for use in debug or error messaging where a the collection of items is relevent
information.
- Parameters:
coll
- Non-null collection of Non-null elements
compareSets
public static int compareSets(java.util.Collection set1,
java.util.Collection set2)
compareSets
public static int compareSets(java.util.Collection set1,
java.util.Collection set2,
java.util.Comparator comparator)
Copyright © 2004-2009. All Rights Reserved.