com.karmasphere.share.util
Class CollectionUtil

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

public class CollectionUtil
extends Object


Method Summary
static
<C,I extends C>
List<I>
filter(List<I> in, Condition<C> f)
          Behaves like Perl's grep { f($) }.
static
<C,I extends C>
Set<I>
filter(Set<I> in, Condition<C> f)
          Behaves like Perl's grep { f($) }.
static
<I,O> List<O>
map(List<I> in, Functor<I,O> f)
          Behaves like Perl's map { f($) }
static
<I,O> Set<O>
map(Set<I> in, Functor<I,O> f)
          Behaves like Perl's map { f($) }
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

map

public static <I,O> List<O> map(List<I> in,
                                Functor<I,O> f)
Behaves like Perl's map { f($) }


filter

public static <C,I extends C> List<I> filter(List<I> in,
                                             Condition<C> f)
Behaves like Perl's grep { f($) }.


map

public static <I,O> Set<O> map(Set<I> in,
                               Functor<I,O> f)
Behaves like Perl's map { f($) }


filter

public static <C,I extends C> Set<I> filter(Set<I> in,
                                            Condition<C> f)
Behaves like Perl's grep { f($) }.



Copyright © 2004-2005 Karamsphere. All Rights Reserved.