| 
deegree 2.6-pre (2011/11/29 00:10 build-378-unofficial) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.framework.util.CollectionUtils
public class CollectionUtils
CollectionUtils contains some functionality missing in Arrays and Collections.
| Nested Class Summary | |
|---|---|
static interface | 
CollectionUtils.Folder<T>
Folder | 
static interface | 
CollectionUtils.Mapper<T,U>
Mapper gives a name to a simple function. | 
static interface | 
CollectionUtils.Predicate<T>
Predicate defines a boolean predicate function interface. | 
| Field Summary | |
|---|---|
static CollectionUtils.Mapper<String,Object> | 
TOSTRINGS
 | 
| Constructor Summary | |
|---|---|
CollectionUtils()
 | 
|
| Method Summary | ||
|---|---|---|
static LinkedList<Integer> | 
asList(int[] vals)
 | 
|
static
 | 
collectionToString(Collection<T> col,
                                     String sep)
 | 
|
static
 | 
contains(Collection<T> col,
                 T obj)
 | 
|
static
 | 
contains(T[] array,
                 T obj)
 | 
|
static
 | 
containsAllEqual(Collection<T> col,
                                 Collection<T> other)
Attention: runs in n*n  | 
|
static
 | 
containsEqual(Collection<T> col,
                           T obj)
 | 
|
static
 | 
filter(Collection<T> col,
             CollectionUtils.Predicate<T> pred)
 | 
|
static
 | 
find(Collection<T> col,
         CollectionUtils.Predicate<T> pred)
 | 
|
static
 | 
find(T[] array,
         CollectionUtils.Predicate<T> pred)
 | 
|
static
 | 
fold(T identity,
         Collection<T> col,
         CollectionUtils.Folder<T> folder)
 | 
|
static
 | 
last(T[] ts)
 | 
|
static
 | 
map(Collection<U> col,
       CollectionUtils.Mapper<T,U> mapper)
Wraps a for loop and the creation of a new list.  | 
|
static
 | 
map(U[] col,
       CollectionUtils.Mapper<T,U> mapper)
Wraps a for loop and the creation of a new list.  | 
|
static
 | 
unzip(Collection<Pair<T,U>> col)
Not quite zip...  | 
|
static
 | 
zip(Map<T,U> map)
Not quite unzip...  | 
|
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final CollectionUtils.Mapper<String,Object> TOSTRINGS
| Constructor Detail | 
|---|
public CollectionUtils()
| Method Detail | 
|---|
public static <T> String collectionToString(Collection<T> col,
                                            String sep)
T - col - may not contain null valuessep - the separating string
public static <T,U> LinkedList<T> map(U[] col,
                                      CollectionUtils.Mapper<T,U> mapper)
T - U - col - mapper - 
public static <T,U> LinkedList<T> map(Collection<U> col,
                                      CollectionUtils.Mapper<T,U> mapper)
T - U - col - mapper - 
public static <T> boolean contains(T[] array,
                                   T obj)
T - array - obj - 
public static <T> boolean contains(Collection<T> col,
                                   T obj)
T - col - obj - 
public static <T> boolean containsEqual(Collection<T> col,
                                        T obj)
T - col - obj - 
public static <T> boolean containsAllEqual(Collection<T> col,
                                           Collection<T> other)
T - col - other - 
public static <T> T find(T[] array,
                         CollectionUtils.Predicate<T> pred)
T - array - pred - 
public static <T> T find(Collection<T> col,
                         CollectionUtils.Predicate<T> pred)
T - col - pred - 
public static <T> LinkedList<T> filter(Collection<T> col,
                                       CollectionUtils.Predicate<T> pred)
T - col - pred - 
public static <T> T fold(T identity,
                         Collection<T> col,
                         CollectionUtils.Folder<T> folder)
T - identity - col - folder - 
public static LinkedList<Integer> asList(int[] vals)
vals - 
public static <T,U> LinkedHashMap<T,U> unzip(Collection<Pair<T,U>> col)
T - U - col - 
public static <T,U> LinkedList<Pair<T,U>> zip(Map<T,U> map)
T - U - map - 
public static <T> T last(T[] ts)
T - ts - 
  | 
deegree 2.6-pre (2011/11/29 00:10 build-378-unofficial) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
an open source project founded by lat/lon, Bonn, Germany.
                    For more information visit: http://www.deegree.org