Package com.kheops.util
Class CollectionUtils
java.lang.Object
com.kheops.util.CollectionUtils
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> Tfind(Collection<T> sourceList, SimplePredicate predicate) To find the first object in a collection that fulfills the condition evaluated by the given predicatestatic <T> List<T> findAll(Collection<T> sourceList, SimplePredicate predicate) To find all objects in a collection that fulfill the condition evaluated by the given predicatestatic <T> intindexOf(Collection<T> sourceList, SimplePredicate predicate) Returns the position in the array where the desired element has been found or -1 if not foundstatic <T> intindexOf(T wanted, Collection<T> sourceList) To obtain the position of an element in a collection.static <T> intindexOf(T wanted, Collection<T> sourceList, MatcherPredicate predicate) Returns the position in the collection where the desired element has been found or -1 if not found.
- 
Constructor Details- 
CollectionUtilspublic CollectionUtils()
 
- 
- 
Method Details- 
indexOfReturns the position in the collection where the desired element has been found or -1 if not found. Designed to be used when the the class does not consistently implement the equals() method- Parameters:
- predicate- A delegate object responsible to evaluate if the wanted object matches the target object in the collection
 
- 
indexOfTo obtain the position of an element in a collection. The object must consistently implement the equals() method.
- 
indexOfReturns the position in the array where the desired element has been found or -1 if not found
- 
findTo find the first object in a collection that fulfills the condition evaluated by the given predicate- Returns:
- The first object found or null if no object found
 
- 
findAllTo find all objects in a collection that fulfill the condition evaluated by the given predicate- Returns:
- The first object found or null if no object found
 
 
-