org.xshare.base.collections.helpers
Class Find

java.lang.Object
  |
  +--org.xshare.base.collections.helpers.Find

public final class Find
extends java.lang.Object

This class contains some helper methods to search for elements in a collection of iteration which satisfy a given condition.

Since:
0.20
Version:
$Revision: 1.1 $
Author:
Oliver Fischer

Method Summary
static java.util.List all(java.util.Collection aSource, UnaryPredicate aCond)
          Checks a given collection of elements for an condition expressed as UnaryPredicate and returns a List with all elements which satisfy the predicate.
static java.util.List all(java.util.Iterator aSource, UnaryPredicate aCond)
          Checks a given iteration of elements for an condition expressed as UnaryPredicate and returns a List with all elements which satisfy the predicate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

all

public static java.util.List all(java.util.Collection aSource,
                                 UnaryPredicate aCond)
Checks a given collection of elements for an condition expressed as UnaryPredicate and returns a List with all elements which satisfy the predicate.

Parameters:
aSource - a Collection representing the collection to scan.
aCond - an UnaryPredicate object representing the condition for the scan.
Returns:
a List object, containing all the elements which satisfy the predicate. If no element satisfied the predicate the returned list is empty.

all

public static java.util.List all(java.util.Iterator aSource,
                                 UnaryPredicate aCond)
Checks a given iteration of elements for an condition expressed as UnaryPredicate and returns a List with all elements which satisfy the predicate.

Parameters:
aSource - a Iterator representing the iteration to scan.
aCond - an UnaryPredicate object representing the condition for the scan.
Returns:
a List object, containing all the elements which satisfy the predicate. If no element satisfied the predicate the returned list is empty.


jKiska Base 0.2.1 Release Esche [http://jkiska.sourceforge.net]