org.codehaus.plexus.util
public class CollectionUtils extends Object
Version: $Id: CollectionUtils.java 8055 2009-01-16 12:45:08Z vsiveton $
Method Summary | |
---|---|
static Map | getCardinalityMap(Collection col)
Returns a Map mapping each unique element in
the given Collection to an Integer
representing the number of occurances of that element
in the Collection.
|
static Collection | intersection(Collection a, Collection b)
Returns a Collection containing the intersection
of the given Collections.
|
static List | iteratorToList(Iterator it) |
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.
|
static Map | mergeMaps(Map[] maps)
Take a series of Map s and merge
them where the ordering of the array from 0..n
is the dominant order.
|
static Collection | subtract(Collection a, Collection b)
Returns a Collection containing a - b.
|
The cardinality of each element in the returned Collection will be equal to the minimum of the cardinality of that element in the two given Collections.
See Also: Collection#retainAll
Parameters: dominantMap Dominant Map. recessiveMap Recessive Map.
Returns: The result map with combined dominant and recessive values.
Map
s 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.
See Also: Collection#removeAll