|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.diasparsoftware.java.util.CollectionUtil
Constructor Summary | |
CollectionUtil()
|
Method Summary | |
static boolean |
detect(java.util.Collection collection,
org.apache.commons.collections.Predicate predicate)
Allows you to detect whether any item in a collection satisfies some acceptance criterion. |
static void |
forEachDo(java.util.Collection collection,
org.apache.commons.collections.Closure closure)
Execute the specified closure for each item in the specified collection. |
static void |
forEachDo(java.util.Collection collection,
ExceptionalClosure closure)
The first exception stops the iteration. |
static void |
forEachDo(java.util.Map map,
ExceptionalMapEntryClosure closure)
Execute the specified closure for each item in the specified collection. |
static void |
forEachDo(java.util.Map map,
MapEntryClosure closure)
Execute the specified closure for each item in the specified collection. |
static void |
forEachDoIgnoreException(java.util.Collection collection,
ExceptionalClosure closure)
Executes closure for each element in the
specified collection, ignoring any thrown exceptions. |
static java.lang.Object |
select(java.util.Set set,
Selector selector)
Selects the first object that the selector
accepts, or null if the selector rejects
them all. |
static boolean |
stringCollectionContainsIgnoreCase(java.util.Collection stringCollection,
java.lang.String searchString)
Searches a collection of String s for the
specified search string, but ignoring case. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CollectionUtil()
Method Detail |
public static boolean detect(java.util.Collection collection, org.apache.commons.collections.Predicate predicate)
collection
- The collection to search inpredicate
- A predicate that should evaluate to true
for the matching object.
public static boolean stringCollectionContainsIgnoreCase(java.util.Collection stringCollection, java.lang.String searchString)
String
s for the
specified search string, but ignoring case.
stringCollection
- A collection of String
ssearchString
- The string to forEachDoIgnoreExceptionsearchString
in here if we ignore case?"public static void forEachDoIgnoreException(java.util.Collection collection, ExceptionalClosure closure)
closure
for each element in the
specified collection, ignoring any thrown exceptions. This
method is designed to be used by the JdbcResourceRegistry
:
at cleanup time, you can't recover from exceptions anyway.
collection
- closure
- public static void forEachDo(java.util.Collection collection, ExceptionalClosure closure) throws java.lang.Exception
collection
- closure
-
java.lang.Exception
public static void forEachDo(java.util.Collection collection, org.apache.commons.collections.Closure closure)
collection
- closure
-
java.lang.Exception
public static void forEachDo(java.util.Map map, MapEntryClosure closure)
closure
-
java.lang.Exception
public static void forEachDo(java.util.Map map, ExceptionalMapEntryClosure closure) throws java.lang.Exception
closure
-
java.lang.Exception
public static java.lang.Object select(java.util.Set set, Selector selector)
selector
accepts, or null
if the selector rejects
them all.
set
- selector
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |