org.aksw.commons.collections
Class MapUtils

java.lang.Object
  extended by org.aksw.commons.collections.MapUtils

public class MapUtils
extends Object

Created by IntelliJ IDEA. User: raven Date: 4/22/11 Time: 2:36 PM To change this template use File | Settings | File Templates.


Constructor Summary
MapUtils()
           
 
Method Summary
static
<K,V> Map<K,V>
createChainMap(Map<K,?> a, Map<?,V> b)
           
static
<K,V> V
getOrCreate(Map<K,V> map, K key, Class<V> clazz, Object... ctorArgs)
           
static
<K,V> V
getOrElse(Map<? extends K,? extends V> map, K key, V elze)
           
static
<K,V> boolean
isCompatible(Map<K,V> a, Map<K,V> b)
          Compatible means that merging the two maps would not result in the same key being mapped to distinct values.
static
<K,V> boolean
isPartiallyCompatible(Map<K,V> a, Map<K,V> b)
           
static
<K,V> com.google.common.collect.Multimap<V,K>
reverse(Map<K,V> map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapUtils

public MapUtils()
Method Detail

isCompatible

public static <K,V> boolean isCompatible(Map<K,V> a,
                                         Map<K,V> b)
Compatible means that merging the two maps would not result in the same key being mapped to distinct values. Or put differently: The union of the two maps retains a functional mapping.

Type Parameters:
K -
V -
Parameters:
a -
b -
Returns:

isPartiallyCompatible

public static <K,V> boolean isPartiallyCompatible(Map<K,V> a,
                                                  Map<K,V> b)

reverse

public static <K,V> com.google.common.collect.Multimap<V,K> reverse(Map<K,V> map)

getOrElse

public static <K,V> V getOrElse(Map<? extends K,? extends V> map,
                                K key,
                                V elze)

createChainMap

public static <K,V> Map<K,V> createChainMap(Map<K,?> a,
                                            Map<?,V> b)

getOrCreate

public static <K,V> V getOrCreate(Map<K,V> map,
                                  K key,
                                  Class<V> clazz,
                                  Object... ctorArgs)


Copyright © 2012. All Rights Reserved.