info.informatica.util
Class CollectionsUtil

java.lang.Object
  extended by info.informatica.util.CollectionsUtil

public class CollectionsUtil
extends Object

Convenience class for Collections utility functions

Version:
1.02
Author:
amengual at informatica dot info

Constructor Summary
CollectionsUtil()
           
 
Method Summary
static
<V> Set<LabeledContainer<V>>
combineStringMap(Map<String,V> mapa, Comparator<? super LabeledContainer<V>> comp)
           
static
<E> Map<E,Integer>
frequency(Iterator<E> it)
          Given an iterator, it returns a Map relating the objects in the iterator with their (Integer) frequency.
static
<V,K> Map<V,K>
swapKeys(Map<K,V> mapa)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionsUtil

public CollectionsUtil()
Method Detail

combineStringMap

public static <V> Set<LabeledContainer<V>> combineStringMap(Map<String,V> mapa,
                                                            Comparator<? super LabeledContainer<V>> comp)

swapKeys

public static <V,K> Map<V,K> swapKeys(Map<K,V> mapa)

frequency

public static <E> Map<E,Integer> frequency(Iterator<E> it)
Given an iterator, it returns a Map relating the objects in the iterator with their (Integer) frequency. Only makes sense for Lists which allows duplicates