org.xerial.util
Class CollectionUtil

java.lang.Object
  extended by org.xerial.util.CollectionUtil

public class CollectionUtil
extends Object


Method Summary
static
<In> List
collect(In[] collection, Functor<In> functor)
           
static
<In> List
collect(Iterable<In> collection, Functor<In> functor)
           
static
<K,V> List
collect(Map<K,V> map, BinaryFunctor<K,V> functor)
           
static
<In> List
collectFromNonGenericCollection(Iterable collection, Functor<In> functor)
           
static
<K,V> String
displayMap(Map<K,V> map, String keyValueSeparator, String elementSeparator)
           
static
<In> List<In>
select(Iterable<In> collection, Predicate<In> filter)
           
static
<E> TreeSet<E>
sort(Collection<E> collection)
           
static
<E> List<E>
toList(E[] array)
          Converts an array into a list
static
<In> List<String>
toString(Collection<In> collection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public static <In> List<String> toString(Collection<In> collection)

collectFromNonGenericCollection

public static <In> List collectFromNonGenericCollection(Iterable collection,
                                                        Functor<In> functor)

select

public static <In> List<In> select(Iterable<In> collection,
                                   Predicate<In> filter)

collect

public static <In> List collect(Iterable<In> collection,
                                Functor<In> functor)

collect

public static <In> List collect(In[] collection,
                                Functor<In> functor)

collect

public static <K,V> List collect(Map<K,V> map,
                                 BinaryFunctor<K,V> functor)

displayMap

public static <K,V> String displayMap(Map<K,V> map,
                                      String keyValueSeparator,
                                      String elementSeparator)

sort

public static <E> TreeSet<E> sort(Collection<E> collection)

toList

public static <E> List<E> toList(E[] array)
Converts an array into a list

Type Parameters:
E -
Parameters:
array -
Returns:
list representation of a given array


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.