|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ode.utils.stl.CollectionsX
public class CollectionsX
Useful extensions to the java.util.Collections class.
Field Summary | |
---|---|
static UnaryFunction<java.util.Map.Entry,java.lang.Object> |
ufnMapEntry_getKey
|
static UnaryFunction<java.util.Map.Entry,java.lang.Object> |
ufnMapEntry_getValue
|
Constructor Summary | |
---|---|
CollectionsX()
|
Method Summary | ||
---|---|---|
static
|
apply(java.util.Collection<T> coll,
UnaryFunction<T,?> f)
|
|
static
|
apply(java.util.Collection<T> coll,
UnaryFunctionEx<T,?> f)
|
|
static
|
apply(java.util.Iterator<T> i,
UnaryFunction<T,?> f)
|
|
static
|
apply(java.util.Iterator<T> i,
UnaryFunctionEx<T,?> f)
|
|
static
|
filter(C dest,
java.util.Collection<S> src,
java.lang.Class<T> t)
|
|
static
|
filter(C dest,
java.util.Collection<S> source,
MemberOfFunction<S> function)
|
|
static
|
filter(C newList,
java.util.Iterator<S> iterator,
java.lang.Class<T> t)
|
|
static
|
filter(C dest,
java.util.Iterator<S> source,
MemberOfFunction<S> function)
|
|
static
|
filter(java.util.Collection src,
java.lang.Class<T> aClass)
Filter a collection by member class. |
|
static
|
find_if(java.util.Collection<T> coll,
MemberOfFunction<? super T> f)
Find an element in a colletion satisfying a condition. |
|
static
|
find_if(java.util.Iterator<T> i,
MemberOfFunction<? super T> f)
Find an element in a collection satisfying a condition. |
|
static
|
insert(java.util.Collection<T> coll,
java.util.Collection<? extends T> src)
|
|
static
|
insert(java.util.Collection<T> coll,
java.util.Enumeration<? extends T> e)
|
|
static
|
insert(java.util.Collection<T> coll,
java.util.Iterator<? extends T> i)
|
|
static
|
remove_if(java.util.Collection<T> coll,
MemberOfFunction<T> f)
Remove elements from collection based on the results of specified unary function. |
|
static
|
transform(C dest,
java.util.Collection<E> src,
UnaryFunction<E,V> f)
Transform a collection with a unary function. |
|
static
|
transform(C dest,
java.util.Enumeration<E> i,
UnaryFunction<E,V> f)
|
|
static
|
transformEx(C dest,
java.util.Collection<E> src,
UnaryFunctionEx<E,V> f)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static UnaryFunction<java.util.Map.Entry,java.lang.Object> ufnMapEntry_getKey
public static UnaryFunction<java.util.Map.Entry,java.lang.Object> ufnMapEntry_getValue
Constructor Detail |
---|
public CollectionsX()
Method Detail |
---|
public static <T> void apply(java.util.Collection<T> coll, UnaryFunction<T,?> f)
public static <T> void apply(java.util.Iterator<T> i, UnaryFunction<T,?> f)
public static <T> void apply(java.util.Collection<T> coll, UnaryFunctionEx<T,?> f) throws java.lang.Exception
java.lang.Exception
public static <T> void apply(java.util.Iterator<T> i, UnaryFunctionEx<T,?> f) throws java.lang.Exception
java.lang.Exception
public static <T> T find_if(java.util.Collection<T> coll, MemberOfFunction<? super T> f)
false
value when the condition is satisfied. The first object in the collection
matching the condition is returned.
coll
- the collection to search throughf
- the test to apply to the collection elements
public static <T> T find_if(java.util.Iterator<T> i, MemberOfFunction<? super T> f)
i
- the iterator to iterate withf
- the test to apply to the elements
find_if(java.util.Collection,
org.apache.ode.utils.stl.MemberOfFunction)
public static <T> java.util.Collection<T> insert(java.util.Collection<T> coll, java.util.Enumeration<? extends T> e)
public static <T> java.util.Collection<T> insert(java.util.Collection<T> coll, java.util.Iterator<? extends T> i)
public static <T> java.util.Collection<T> insert(java.util.Collection<T> coll, java.util.Collection<? extends T> src)
public static <T> java.util.Collection<T> remove_if(java.util.Collection<T> coll, MemberOfFunction<T> f)
f.isMember(element)
returns true
. So: coll' = { x : x el-of coll
AND f(x) == false }
coll
- the collection from which to remove elementsf
- the function to apply
public static <C extends java.util.Collection<T>,T,V extends T,E> C transform(C dest, java.util.Collection<E> src, UnaryFunction<E,V> f)
dest
- the empty (mutable) collection to transform intosrc
- the collection to transform fromf
- the unary function to apply
public static <C extends java.util.Collection<T>,T,V extends T,E> C transformEx(C dest, java.util.Collection<E> src, UnaryFunctionEx<E,V> f) throws java.lang.Exception
java.lang.Exception
public static <C extends java.util.Collection<T>,T,V extends T,E> C transform(C dest, java.util.Enumeration<E> i, UnaryFunction<E,V> f)
public static <C extends java.util.Collection<T>,T,S extends T> C filter(C dest, java.util.Collection<S> source, MemberOfFunction<S> function)
public static <C extends java.util.Collection<T>,T,S extends T> C filter(C dest, java.util.Iterator<S> source, MemberOfFunction<S> function)
public static <C extends java.util.Collection<T>,S,T extends S> C filter(C dest, java.util.Collection<S> src, java.lang.Class<T> t)
public static <C extends java.util.Collection<T>,S,T extends S> C filter(C newList, java.util.Iterator<S> iterator, java.lang.Class<T> t)
public static <T> java.util.Collection<T> filter(java.util.Collection src, java.lang.Class<T> aClass)
src
- source collectionaClass
- requested class
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |