com.karmasphere.share.util
Class MapUtil

java.lang.Object
  extended by com.karmasphere.share.util.MapUtil

public class MapUtil
extends Object


Method Summary
static
<I,K,V> Map<K,Set<V>>
collate(Set<I> s, Functor<I,K> f, Functor<I,V> g)
          Returns map { f(\$_) => { g(\$_) } }
static
<K,V> Map<K,Set<V>>
collate(Set<V> s, Functor<V,K> f)
          Returns map { f(\$_) => { \$_ } }
static
<K,V> Map<K,V>
map(Set<V> s, Functor<V,K> f)
          Behaves like Perl's map { \$_ => f(\$_) }
static
<K,V> Map<K,Set<V>>
scatter(Set<V> s, Functor<V,Set<K>> f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

collate

public static <K,V> Map<K,Set<V>> collate(Set<V> s,
                                          Functor<V,K> f)
Returns map { f(\$_) => { \$_ } }


collate

public static <I,K,V> Map<K,Set<V>> collate(Set<I> s,
                                            Functor<I,K> f,
                                            Functor<I,V> g)
Returns map { f(\$_) => { g(\$_) } }


map

public static <K,V> Map<K,V> map(Set<V> s,
                                 Functor<V,K> f)
Behaves like Perl's map { \$_ => f(\$_) }


scatter

public static <K,V> Map<K,Set<V>> scatter(Set<V> s,
                                          Functor<V,Set<K>> f)


Copyright © 2004-2005 Karamsphere. All Rights Reserved.