|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.extra166y.CommonOps
public class CommonOps
A collection of static factory methods providing commonly useful implementations of operations.
Constructor Summary | |
private CommonOps()
|
Method Summary | |
---|---|
static Predicate
|
andPredicate(Predicate first, Predicate second)
Returns a predicate evaluating to the conjunction of its contained predicates. |
static DoublePredicate
|
andPredicate(DoublePredicate first, DoublePredicate second)
Returns a predicate evaluating to the conjunction of its contained predicates. |
static LongPredicate
|
andPredicate(LongPredicate first, LongPredicate second)
Returns a predicate evaluating to the conjunction of its contained predicates. |
static java.util.Comparator
|
castedComparator()
Returns a Comparator that casts its arguments as Comparable on each comparison, throwing ClassCastException on failure. |
static Reducer
|
castedMaxReducer()
Returns a reducer returning maximum of two values, or
|
static Reducer
|
castedMinReducer()
Returns a reducer returning minimum of two values, or
|
static Op
|
compoundOp(Op first, Op second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static Op
|
compoundOp(ObjectToDouble first, DoubleToObject second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static Op
|
compoundOp(ObjectToLong first, LongToObject second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleToObject
|
compoundOp(DoubleToObject first, Op second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongToObject
|
compoundOp(LongToObject first, Op second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static ObjectToDouble
|
compoundOp(Op first, ObjectToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static ObjectToLong
|
compoundOp(Op first, ObjectToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static ObjectToDouble
|
compoundOp(ObjectToDouble first, DoubleOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static ObjectToLong
|
compoundOp(ObjectToDouble first, DoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static ObjectToLong
|
compoundOp(ObjectToLong first, LongOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static ObjectToDouble
|
compoundOp(ObjectToLong first, LongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleOp
|
compoundOp(DoubleOp first, DoubleOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleToLong
|
compoundOp(DoubleOp first, DoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleToLong
|
compoundOp(DoubleToLong first, LongOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleToObject
|
compoundOp(DoubleToLong first, LongToObject second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongToObject
|
compoundOp(LongToDouble first, DoubleToObject second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongToDouble
|
compoundOp(LongOp first, LongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongToDouble
|
compoundOp(LongToDouble first, DoubleOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleToObject
|
compoundOp(DoubleOp first, DoubleToObject second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongToObject
|
compoundOp(LongOp first, LongToObject second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleOp
|
compoundOp(DoubleToObject first, ObjectToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongToDouble
|
compoundOp(LongToObject first, ObjectToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleToLong
|
compoundOp(DoubleToObject first, ObjectToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongOp
|
compoundOp(LongToObject first, ObjectToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongOp
|
compoundOp(LongOp first, LongOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleOp
|
compoundOp(DoubleToLong first, LongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static LongOp
|
compoundOp(LongToDouble first, DoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one. |
static DoubleReducer
|
doubleAdder()
Returns a reducer that adds two double elements. |
static BinaryDoublePredicate
|
doubleEqualityPredicate()
Returns a predicate evaluating to true if the
first argument |
static BinaryDoublePredicate
|
doubleInequalityPredicate()
Returns a predicate evaluating to true if the first argument {@code ! |
static DoubleReducer
|
doubleMaxReducer(DoubleComparator comparator)
Returns a reducer returning the maximum of two double elements, using the given comparator. |
static DoubleReducer
|
doubleMinReducer(DoubleComparator comparator)
Returns a reducer returning the minimum of two double elements, using the given comparator. |
static DoubleGenerator
|
doubleRandom()
Returns a generator producing uniform random values between zero and one, with the same properties as java.util.Random#nextDouble. |
static DoubleGenerator
|
doubleRandom(double bound)
Returns a generator producing uniform random values between zero and the given bound, with the same properties as java.util.Random#nextDouble. |
static DoubleGenerator
|
doubleRandom(double least, double bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive). |
static BinaryPredicate
|
equalityPredicate()
Returns a predicate evaluating to true if the
first argument |
static BinaryPredicate
|
identityPredicate()
Returns a predicate evaluating to true if the
first argument |
static BinaryPredicate
|
inequalityPredicate()
Returns a predicate evaluating to true if the first argument {@code ! |
static Predicate
|
instanceofPredicate(java.lang.Class type)
Returns a predicate evaluating to true if its argument is an instance of (see java.lang.Class#isInstance the given type (class). |
static IntReducer
|
intAdder()
Returns a reducer that adds two int elements. |
static BinaryIntPredicate
|
intEqualityPredicate()
Returns a predicate evaluating to true if the
first argument |
static BinaryIntPredicate
|
intInequalityPredicate()
Returns a predicate evaluating to true if the first argument {@code ! |
static IntGenerator
|
intRandom()
Returns a generator producing uniform random values with the same properties as java.util.Random#nextInt. |
static IntGenerator
|
intRandom(int bound)
Returns a generator producing uniform random values with the same properties as java.util.Random#nextInt(int). |
static IntGenerator
|
intRandom(int least, int bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive). |
static Predicate
|
isAssignablePredicate(java.lang.Class type)
Returns a predicate evaluating to true if its argument is assignable from (see java.lang.Class#isAssignableFrom the given type (class). |
static Predicate
|
isNonNullPredicate()
Returns a predicate evaluating to true if its argument is non-null. |
static Predicate
|
isNullPredicate()
Returns a predicate evaluating to true if its argument is null. |
static LongReducer
|
longAdder()
Returns a reducer that adds two long elements. |
static BinaryLongPredicate
|
longEqualityPredicate()
Returns a predicate evaluating to true if the
first argument |
static BinaryLongPredicate
|
longInequalityPredicate()
Returns a predicate evaluating to true if the
first argument |
static LongReducer
|
longMaxReducer(LongComparator comparator)
Returns a reducer returning the maximum of two long elements, using the given comparator. |
static LongReducer
|
longMinReducer(LongComparator comparator)
Returns a reducer returning the minimum of two long elements, using the given comparator. |
static LongGenerator
|
longRandom()
Returns a generator producing uniform random values with the same properties as java.util.Random#nextLong. |
static LongGenerator
|
longRandom(long bound)
Returns a generator producing uniform random values with the same properties as java.util.Random#nextInt(int). |
static LongGenerator
|
longRandom(long least, long bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive). |
static Reducer
|
maxReducer(java.util.Comparator comparator)
Returns a reducer returning the maximum of two elements, using the given comparator, and treating null as less than any non-null element. |
static Reducer
|
minReducer(java.util.Comparator comparator)
Returns a reducer returning the minimum of two elements, using the given comparator, and treating null as greater than any non-null element. |
static java.util.Comparator
|
naturalComparator(java.lang.Class type)
Returns a Comparator for Comparable objects. |
static DoubleComparator
|
naturalDoubleComparator()
Returns a comparator for doubles relying on natural ordering. |
static DoubleReducer
|
naturalDoubleMaxReducer()
Returns a reducer returning the maximum of two double elements, using natural comparator. |
static DoubleReducer
|
naturalDoubleMinReducer()
Returns a reducer returning the minimum of two double elements, using natural comparator. |
static LongComparator
|
naturalLongComparator()
Returns a comparator for longs relying on natural ordering. |
static LongReducer
|
naturalLongMaxReducer()
Returns a reducer returning the maximum of two long elements, using natural comparator. |
static LongReducer
|
naturalLongMinReducer()
A reducer returning the minimum of two long elements, using natural comparator. |
static Reducer
|
naturalMaxReducer(java.lang.Class type)
Returns a reducer returning the maximum of two Comparable elements, treating null as less than any non-null element. |
static Reducer
|
naturalMinReducer(java.lang.Class type)
Returns a reducer returning the minimum of two Comparable elements, treating null as greater than any non-null element. |
static BinaryPredicate
|
nonidentityPredicate()
Returns a predicate evaluating to true if the first argument {@code ! |
static Predicate
|
notPredicate(Predicate pred)
Returns a predicate evaluating to the negation of its contained predicate. |
static DoublePredicate
|
notPredicate(DoublePredicate pred)
Returns a predicate evaluating to the negation of its contained predicate. |
static LongPredicate
|
notPredicate(LongPredicate pred)
Returns a predicate evaluating to the negation of its contained predicate. |
static Predicate
|
orPredicate(Predicate first, Predicate second)
Returns a predicate evaluating to the disjunction of its contained predicates. |
static DoublePredicate
|
orPredicate(DoublePredicate first, DoublePredicate second)
Returns a predicate evaluating to the disjunction of its contained predicates. |
static LongPredicate
|
orPredicate(LongPredicate first, LongPredicate second)
Returns a predicate evaluating to the disjunction of its contained predicates. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
private CommonOps()
Method Detail |
---|
public static Predicate andPredicate(Predicate first, Predicate second)
public static DoublePredicate andPredicate(DoublePredicate first, DoublePredicate second)
public static LongPredicate andPredicate(LongPredicate first, LongPredicate second)
public static java.util.Comparator castedComparator()
public static Reducer castedMaxReducer()
null
if both arguments are null, and that casts
its arguments as Comparable on each comparison, throwing
ClassCastException on failure.
public static Reducer castedMinReducer()
null
if both arguments are null, and that casts
its arguments as Comparable on each comparison, throwing
ClassCastException on failure.
public static Op compoundOp(Op first, Op second)
public static Op compoundOp(ObjectToDouble first, DoubleToObject second)
public static Op compoundOp(ObjectToLong first, LongToObject second)
public static DoubleToObject compoundOp(DoubleToObject first, Op second)
public static LongToObject compoundOp(LongToObject first, Op second)
public static ObjectToDouble compoundOp(Op first, ObjectToDouble second)
public static ObjectToLong compoundOp(Op first, ObjectToLong second)
public static ObjectToDouble compoundOp(ObjectToDouble first, DoubleOp second)
public static ObjectToLong compoundOp(ObjectToDouble first, DoubleToLong second)
public static ObjectToLong compoundOp(ObjectToLong first, LongOp second)
public static ObjectToDouble compoundOp(ObjectToLong first, LongToDouble second)
public static DoubleOp compoundOp(DoubleOp first, DoubleOp second)
public static DoubleToLong compoundOp(DoubleOp first, DoubleToLong second)
public static DoubleToLong compoundOp(DoubleToLong first, LongOp second)
public static DoubleToObject compoundOp(DoubleToLong first, LongToObject second)
public static LongToObject compoundOp(LongToDouble first, DoubleToObject second)
public static LongToDouble compoundOp(LongOp first, LongToDouble second)
public static LongToDouble compoundOp(LongToDouble first, DoubleOp second)
public static DoubleToObject compoundOp(DoubleOp first, DoubleToObject second)
public static LongToObject compoundOp(LongOp first, LongToObject second)
public static DoubleOp compoundOp(DoubleToObject first, ObjectToDouble second)
public static LongToDouble compoundOp(LongToObject first, ObjectToDouble second)
public static DoubleToLong compoundOp(DoubleToObject first, ObjectToLong second)
public static LongOp compoundOp(LongToObject first, ObjectToLong second)
public static LongOp compoundOp(LongOp first, LongOp second)
public static DoubleOp compoundOp(DoubleToLong first, LongToDouble second)
public static LongOp compoundOp(LongToDouble first, DoubleToLong second)
public static DoubleReducer doubleAdder()
public static BinaryDoublePredicate doubleEqualityPredicate()
==
the second.
public static BinaryDoublePredicate doubleInequalityPredicate()
!=
the second.
public static DoubleReducer doubleMaxReducer(DoubleComparator comparator)
public static DoubleReducer doubleMinReducer(DoubleComparator comparator)
public static DoubleGenerator doubleRandom()
public static DoubleGenerator doubleRandom(double bound)
bound
- the upper bound (exclusive) of opd values
public static DoubleGenerator doubleRandom(double least, double bound)
least
- the least value returnedbound
- the upper bound (exclusive) of opd values
public static BinaryPredicate equalityPredicate()
equals
the second.
public static BinaryPredicate identityPredicate()
==
the second.
public static BinaryPredicate inequalityPredicate()
!equals
the second.
public static Predicate instanceofPredicate(java.lang.Class type)
public static IntReducer intAdder()
public static BinaryIntPredicate intEqualityPredicate()
==
the second.
public static BinaryIntPredicate intInequalityPredicate()
!=
the second.
public static IntGenerator intRandom()
public static IntGenerator intRandom(int bound)
bound
- the upper bound (exclusive) of opd values
public static IntGenerator intRandom(int least, int bound)
least
- the least value returnedbound
- the upper bound (exclusive) of opd values
public static Predicate isAssignablePredicate(java.lang.Class type)
public static Predicate isNonNullPredicate()
public static Predicate isNullPredicate()
public static LongReducer longAdder()
public static BinaryLongPredicate longEqualityPredicate()
==
the second.
public static BinaryLongPredicate longInequalityPredicate()
==
the second.
public static LongReducer longMaxReducer(LongComparator comparator)
public static LongReducer longMinReducer(LongComparator comparator)
public static LongGenerator longRandom()
public static LongGenerator longRandom(long bound)
bound
- the upper bound (exclusive) of opd values
public static LongGenerator longRandom(long least, long bound)
least
- the least value returnedbound
- the upper bound (exclusive) of opd values
public static Reducer maxReducer(java.util.Comparator comparator)
public static Reducer minReducer(java.util.Comparator comparator)
public static java.util.Comparator naturalComparator(java.lang.Class type)
public static DoubleComparator naturalDoubleComparator()
public static DoubleReducer naturalDoubleMaxReducer()
public static DoubleReducer naturalDoubleMinReducer()
public static LongComparator naturalLongComparator()
public static LongReducer naturalLongMaxReducer()
public static LongReducer naturalLongMinReducer()
public static Reducer naturalMaxReducer(java.lang.Class type)
public static Reducer naturalMinReducer(java.lang.Class type)
public static BinaryPredicate nonidentityPredicate()
!=
the second.
public static Predicate notPredicate(Predicate pred)
public static DoublePredicate notPredicate(DoublePredicate pred)
public static LongPredicate notPredicate(LongPredicate pred)
public static Predicate orPredicate(Predicate first, Predicate second)
public static DoublePredicate orPredicate(DoublePredicate first, DoublePredicate second)
public static LongPredicate orPredicate(LongPredicate first, LongPredicate second)
Copyright © 2008–2013 Václav Pech. All Rights Reserved.