|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.xshare.base.collections.helpers.ForAll
This class contains some helper methods which perform sometimes needed operations for collections and iterations.
Collections.max(Collection)
method. Since the implementation of this method seems to be
not null safe, you should consider to use
the SkipNullIterator.
| Method Summary | |
static boolean |
and(java.util.Collection aCollection,
GetBooleanMethod aAdaptor)
Returns the conjunction of all boolean values returned
by the GetBooleanMethod
adaptor for every element of a iteration. |
static boolean |
and(java.util.Iterator aIterator,
GetBooleanMethod aAdaptor)
Returns the conjunction of all boolean values returned
by the GetBooleanMethod
adaptor for every element of a iteration. |
static boolean |
check(java.util.Collection aCollection,
UnaryPredicate aPredicate)
Checks every object of a given collection, if it satisfies a given condition. |
static boolean |
check(java.util.Iterator aIterator,
UnaryPredicate aPredicate)
Checks every object of a given iteration, if it satisfies a given condition. |
static void |
exec(java.util.Collection aCollection,
Closure aOperation)
Executes the given Closure
for every element in the given collection. |
static void |
exec(java.util.Iterator aIteration,
Closure aOperation)
Executes the given Closure
for every element in the given iteration. |
static boolean |
or(java.util.Collection aCollection,
GetBooleanMethod aAdaptor)
Returns the boolean conjunction with or of all boolean values returned
by the GetBooleanMethod
adaptor for every element. |
static boolean |
or(java.util.Iterator aIterator,
GetBooleanMethod aAdaptor)
Returns the boolean conjunction with or of all boolean values returned
by the GetBooleanMethod
adaptor for every element. |
static double |
sumDouble(java.util.Iterator aIteration,
GetDoubleMethod aAdaptor)
Computes the sum of all double values returned
by the GetDoubleMethod
adaptor for every element. |
static float |
sumFloat(java.util.Collection aCollection,
GetFloatMethod aAdaptor)
Computes the sum of all float values returned
by the GetFloatMethod
adaptor for every element. |
static float |
sumFloat(java.util.Iterator aIterator,
GetFloatMethod aAdaptor)
Computes the sum of all float values returned
by the GetFloatMethod
adaptor for every element. |
static int |
sumInt(java.util.Collection aCollection,
GetIntMethod aAdapter)
Computes the sum of all int values returned
by the GetIntMethod
adaptor for every element of a given collection. |
static int |
sumInt(java.util.Iterator aIterator,
GetIntMethod aAdaptor)
Computes the sum of all int values returned
by the GetIntMethod
adaptor for every element of a given iteration. |
static long |
sumLong(java.util.Collection aCollection,
GetLongMethod aAdaptor)
Describe sumLong method here. |
static long |
sumLong(java.util.Iterator aIterator,
GetLongMethod aAdaptor)
Describe sumLong method here. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void exec(java.util.Iterator aIteration,
Closure aOperation)
Closure
for every element in the given iteration.
aOperation - a Closure object representing the
operation to execute on every object.aIteration - an Iterator pointing to the elements
to pass to the given operation.
public static void exec(java.util.Collection aCollection,
Closure aOperation)
Closure
for every element in the given collection.
aCollection - a Collection object containing
all the elements, which will be passed to the given closure.aOperation - a Closure object representing the
operation to execute on every object.
public static double sumDouble(java.util.Iterator aIteration,
GetDoubleMethod aAdaptor)
double values returned
by the GetDoubleMethod
adaptor for every element.
aIteration - an Iterator valueaAdaptor - a GetDoubleMethod value
double value containing the
sum of all accessed double values.
OverRunException - if the result becomes larger
then Double.MAX_VALUE.
public static int sumInt(java.util.Collection aCollection,
GetIntMethod aAdapter)
int values returned
by the GetIntMethod
adaptor for every element of a given collection.
aCollection - a Collection valueaAdapter - a GetIntMethod value
int value containing the
sum of all accessed int values.
OverRunException - if the result becomes larger
then Integer.MAX_VALUE.
public static int sumInt(java.util.Iterator aIterator,
GetIntMethod aAdaptor)
int values returned
by the GetIntMethod
adaptor for every element of a given iteration.
aIterator - an Iterator valueaAdaptor - a GetIntMethod value
int value containing the
sum of all accessed int values.
OverRunException - if the result becomes larger
then Integer.MAX_VALUE.
public static long sumLong(java.util.Iterator aIterator,
GetLongMethod aAdaptor)
sumLong method here.
aIterator - an Iterator valueaAdaptor - a GetLongMethod value
long value
public static long sumLong(java.util.Collection aCollection,
GetLongMethod aAdaptor)
sumLong method here.
aCollection - a Collection valueaAdaptor - a GetLongMethod value
long value
public static float sumFloat(java.util.Iterator aIterator,
GetFloatMethod aAdaptor)
float values returned
by the GetFloatMethod
adaptor for every element.
aIterator - an Iterator valueaAdaptor - a GetFloatMethod value
float value containing the
sum of all accessed float values.
OverRunException - if the result becomes larger
then Float.MAX_VALUE.
public static float sumFloat(java.util.Collection aCollection,
GetFloatMethod aAdaptor)
float values returned
by the GetFloatMethod
adaptor for every element.
aCollection - a Collection valueaAdaptor - a GetFloatMethod value
float value containing the
sum of all accessed float values.
OverRunException - if the result becomes larger
then Float.MAX_VALUE.
public static boolean check(java.util.Collection aCollection,
UnaryPredicate aPredicate)
UnaryPredicate.
aCollection - a Collection valueaPredicate - an UnaryPredicate value
boolean value
public static boolean check(java.util.Iterator aIterator,
UnaryPredicate aPredicate)
UnaryPredicate.
aIterator - an Iterator valueaPredicate - an UnaryPredicate value
boolean value
public static boolean and(java.util.Iterator aIterator,
GetBooleanMethod aAdaptor)
boolean values returned
by the GetBooleanMethod
adaptor for every element of a iteration.
aIterator - an Iterator valueaAdaptor - a GetBooleanMethod value
boolean value containing the
result of this conjunction.
public static boolean and(java.util.Collection aCollection,
GetBooleanMethod aAdaptor)
boolean values returned
by the GetBooleanMethod
adaptor for every element of a iteration.
aCollection - a Collection valueaAdaptor - a GetBooleanMethod value
boolean value containing the
result of this conjunction.
public static boolean or(java.util.Collection aCollection,
GetBooleanMethod aAdaptor)
boolean values returned
by the GetBooleanMethod
adaptor for every element.
aCollection - a Collection valueaAdaptor - a GetBooleanMethod value
boolean value containing the
result of this or conjuntion.
public static boolean or(java.util.Iterator aIterator,
GetBooleanMethod aAdaptor)
boolean values returned
by the GetBooleanMethod
adaptor for every element.
aIterator - an Iterator valueaAdaptor - a GetBooleanMethod value
boolean value containing the
result of this or conjuntion.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||