| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.codehaus.plexus.util.CollectionUtilspublic class CollectionUtilsextends java.lang.ObjectMethod Summary | |
static Map |
|
static Collection |
|
static List |
|
static Map |
|
static Map |
|
static Collection |
|
public static Map getCardinalityMap(Collection col)
Returns aMapmapping each unique element in the givenCollectionto anIntegerrepresenting the number of occurances of that element in theCollection. An entry that maps to null indicates that the element does not appear in the givenCollection.
public static Collection intersection(Collection a,
Collection b)Returns aCollectioncontaining the intersection of the givenCollections. The cardinality of each element in the returnedCollectionwill be equal to the minimum of the cardinality of that element in the two givenCollections.
- See Also:
Collection.retainAll
public static List iteratorToList(Iterator it)
public static Map mergeMaps(Map dominantMap,
Map recessiveMap)Take a dominant and recessive Map and merge the key:value pairs where the recessive Map may add key:value pairs to the dominant Map but may not override any existing key:value pairs. If we have two Maps, a dominant and recessive, and their respective keys are as follows: dominantMapKeys = { a, b, c, d, e, f } recessiveMapKeys = { a, b, c, x, y, z } Then the result should be the following: resultantKeys = { a, b, c, d, e, f, x, y, z }
- Parameters:
dominantMap- Dominant Map.recessiveMap- Recessive Map.
- Returns:
- The result map with combined dominant and recessive values.
public static Map mergeMaps(Map[] maps)
Take a series ofMaps and merge them where the ordering of the array from 0..n is the dominant order.
- Parameters:
maps- An array of Maps to merge.
- Returns:
- Map The result Map produced after the merging process.
public static Collection subtract(Collection a,
Collection b)Returns aCollectioncontaining a - b. The cardinality of each element e in the returnedCollectionwill be the cardinality of e in a minus the cardinality of e in b, or zero, whichever is greater.
- See Also:
Collection.removeAll