|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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<java.lang.String,java.lang.Object> |
TOSTRINGS
|
Constructor Summary | |
---|---|
CollectionUtils()
|
Method Summary | ||
---|---|---|
static java.util.LinkedList<java.lang.Integer> |
asList(int[] vals)
|
|
static
|
collectionToString(java.util.Collection<T> col,
java.lang.String sep)
|
|
static
|
contains(java.util.Collection<T> col,
T obj)
|
|
static
|
contains(T[] array,
T obj)
|
|
static
|
containsAllEqual(java.util.Collection<T> col,
java.util.Collection<T> other)
Attention: runs in n*n |
|
static
|
containsEqual(java.util.Collection<T> col,
T obj)
|
|
static
|
filter(java.util.Collection<T> col,
CollectionUtils.Predicate<T> pred)
|
|
static
|
find(java.util.Collection<T> col,
CollectionUtils.Predicate<T> pred)
|
|
static
|
find(T[] array,
CollectionUtils.Predicate<T> pred)
|
|
static
|
fold(T identity,
java.util.Collection<T> col,
CollectionUtils.Folder<T> folder)
|
|
static
|
last(T[] ts)
|
|
static
|
map(java.util.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(java.util.Collection<Pair<T,U>> col)
Not quite zip... |
|
static
|
zip(java.util.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<java.lang.String,java.lang.Object> TOSTRINGS
Constructor Detail |
---|
public CollectionUtils()
Method Detail |
---|
public static <T> java.lang.String collectionToString(java.util.Collection<T> col, java.lang.String sep)
T
- col
- may not contain null valuessep
- the separating string
public static <T,U> java.util.LinkedList<T> map(U[] col, CollectionUtils.Mapper<T,U> mapper)
T
- U
- col
- mapper
-
public static <T,U> java.util.LinkedList<T> map(java.util.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(java.util.Collection<T> col, T obj)
T
- col
- obj
-
public static <T> boolean containsEqual(java.util.Collection<T> col, T obj)
T
- col
- obj
-
public static <T> boolean containsAllEqual(java.util.Collection<T> col, java.util.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(java.util.Collection<T> col, CollectionUtils.Predicate<T> pred)
T
- col
- pred
-
public static <T> java.util.LinkedList<T> filter(java.util.Collection<T> col, CollectionUtils.Predicate<T> pred)
T
- col
- pred
-
public static <T> T fold(T identity, java.util.Collection<T> col, CollectionUtils.Folder<T> folder)
T
- identity
- col
- folder
-
public static java.util.LinkedList<java.lang.Integer> asList(int[] vals)
vals
-
public static <T,U> java.util.LinkedHashMap<T,U> unzip(java.util.Collection<Pair<T,U>> col)
T
- U
- col
-
public static <T,U> java.util.LinkedList<Pair<T,U>> zip(java.util.Map<T,U> map)
T
- U
- map
-
public static <T> T last(T[] ts)
T
- ts
-
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
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