org.dllearner.utilities.datastructures
Class Maps

java.lang.Object
  extended by org.dllearner.utilities.datastructures.Maps

public class Maps
extends Object

Author:
Jens Lehmann

Constructor Summary
Maps()
           
 
Method Summary
static
<X,Y> Map<Y,Collection<X>>
revert(Map<X,Y> map)
          Reverts a map, i.e. if the map contains an entry x => y, then the returned map contains an entry y => x.
static
<X,Y> Map<Y,Collection<X>>
revertCollectionMap(Map<X,Collection<Y>> map)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Maps

public Maps()
Method Detail

revert

public static <X,Y> Map<Y,Collection<X>> revert(Map<X,Y> map)
Reverts a map, i.e. if the map contains an entry x => y, then the returned map contains an entry y => x. (The minimal map with this property is returned.)

Type Parameters:
X - Type of map keys.
Y - Type of map values
Parameters:
map - The map to invert.
Returns:
A reverted map.

revertCollectionMap

public static <X,Y> Map<Y,Collection<X>> revertCollectionMap(Map<X,Collection<Y>> map)


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann