|
||||||||||
PREV CLASS NEXT CLASS | 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.
Nested Class Summary | |
---|---|
(package private) static class |
CommonOps.DoubleAdder
|
(package private) static class |
CommonOps.DoubleBoundedRandomGenerator
|
(package private) static class |
CommonOps.DoubleEqualityPredicate
|
(package private) static class |
CommonOps.DoubleInequalityPredicate
|
(package private) static class |
CommonOps.DoubleIntervalRandomGenerator
|
(package private) static class |
CommonOps.DoubleRandomGenerator
|
(package private) static class |
CommonOps.EqualityPredicate
|
(package private) static class |
CommonOps.IdentityPredicate
|
(package private) static class |
CommonOps.InequalityPredicate
|
(package private) static class |
CommonOps.IntAdder
|
(package private) static class |
CommonOps.IntBoundedRandomGenerator
|
(package private) static class |
CommonOps.IntEqualityPredicate
|
(package private) static class |
CommonOps.IntInequalityPredicate
|
(package private) static class |
CommonOps.IntIntervalRandomGenerator
|
(package private) static class |
CommonOps.IntRandomGenerator
|
(package private) static class |
CommonOps.IsNonNullPredicate
|
(package private) static class |
CommonOps.IsNullPredicate
|
(package private) static class |
CommonOps.LongAdder
|
(package private) static class |
CommonOps.LongBoundedRandomGenerator
|
(package private) static class |
CommonOps.LongEqualityPredicate
|
(package private) static class |
CommonOps.LongInequalityPredicate
|
(package private) static class |
CommonOps.LongIntervalRandomGenerator
|
(package private) static class |
CommonOps.LongRandomGenerator
|
(package private) static class |
CommonOps.NaturalDoubleComparator
|
(package private) static class |
CommonOps.NaturalDoubleMaxReducer
|
(package private) static class |
CommonOps.NaturalDoubleMinReducer
|
(package private) static class |
CommonOps.NaturalLongComparator
|
(package private) static class |
CommonOps.NaturalLongMaxReducer
|
(package private) static class |
CommonOps.NaturalLongMinReducer
|
(package private) static class |
CommonOps.NonidentityPredicate
|
(package private) static class |
CommonOps.RawComparator
|
(package private) static class |
CommonOps.RawMaxReducer
|
(package private) static class |
CommonOps.RawMinReducer
|
Constructor Summary | |
---|---|
private |
CommonOps()
|
Method Summary | ||
---|---|---|
static Ops.DoublePredicate |
andPredicate(Ops.DoublePredicate first,
Ops.DoublePredicate second)
Returns a predicate evaluating to the conjunction of its contained predicates |
|
static Ops.LongPredicate |
andPredicate(Ops.LongPredicate first,
Ops.LongPredicate second)
Returns a predicate evaluating to the conjunction of its contained predicates |
|
static
|
andPredicate(Ops.Predicate<S> first,
Ops.Predicate<? super T> second)
Returns a predicate evaluating to the conjunction of its contained predicates |
|
static java.util.Comparator<java.lang.Object> |
castedComparator()
Returns a Comparator that casts its arguments as Comparable on each comparison, throwing ClassCastException on failure. |
|
static Ops.Reducer<java.lang.Object> |
castedMaxReducer()
Returns a reducer returning maximum of two values, or null if both arguments are null, and that casts its arguments as Comparable on each comparison, throwing ClassCastException on failure. |
|
static Ops.Reducer<java.lang.Object> |
castedMinReducer()
Returns a reducer returning minimum of two values, or null if both arguments are null, and that casts its arguments as Comparable on each comparison, throwing ClassCastException on failure. |
|
static Ops.DoubleOp |
compoundOp(Ops.DoubleOp first,
Ops.DoubleOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.DoubleToLong |
compoundOp(Ops.DoubleOp first,
Ops.DoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.DoubleOp first,
Ops.DoubleToObject<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.DoubleToLong |
compoundOp(Ops.DoubleToLong first,
Ops.LongOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.DoubleOp |
compoundOp(Ops.DoubleToLong first,
Ops.LongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.DoubleToLong first,
Ops.LongToObject<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.DoubleToObject<? extends T> first,
Ops.ObjectToDouble<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.DoubleToObject<? extends T> first,
Ops.ObjectToLong<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.DoubleToObject<? extends T> first,
Ops.Op<? super T,? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.LongOp |
compoundOp(Ops.LongOp first,
Ops.LongOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.LongToDouble |
compoundOp(Ops.LongOp first,
Ops.LongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.LongOp first,
Ops.LongToObject<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.LongToDouble |
compoundOp(Ops.LongToDouble first,
Ops.DoubleOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.LongOp |
compoundOp(Ops.LongToDouble first,
Ops.DoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.LongToDouble first,
Ops.DoubleToObject<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.LongToObject<? extends T> first,
Ops.ObjectToDouble<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.LongToObject<? extends T> first,
Ops.ObjectToLong<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.LongToObject<? extends T> first,
Ops.Op<? super T,? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.ObjectToDouble<? super T> first,
Ops.DoubleOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.ObjectToDouble<? super T> first,
Ops.DoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.ObjectToDouble<? super T> first,
Ops.DoubleToObject<? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.ObjectToLong<? super T> first,
Ops.LongOp second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.ObjectToLong<? super T> first,
Ops.LongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.ObjectToLong<? super T> first,
Ops.LongToObject<? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.Op<? super T,? extends U> first,
Ops.ObjectToDouble<? super U> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.Op<? super T,? extends U> first,
Ops.ObjectToLong<? super U> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static
|
compoundOp(Ops.Op<? super T,? extends U> first,
Ops.Op<? super U,? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one |
|
static Ops.DoubleReducer |
doubleAdder()
Returns a reducer that adds two double elements |
|
static Ops.BinaryDoublePredicate |
doubleEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the second |
|
static Ops.BinaryDoublePredicate |
doubleInequalityPredicate()
Returns a predicate evaluating to true if the first argument ! |
|
static Ops.DoubleReducer |
doubleMaxReducer(Ops.DoubleComparator comparator)
Returns a reducer returning the maximum of two double elements, using the given comparator |
|
static Ops.DoubleReducer |
doubleMinReducer(Ops.DoubleComparator comparator)
Returns a reducer returning the minimum of two double elements, using the given comparator |
|
static Ops.DoubleGenerator |
doubleRandom()
Returns a generator producing uniform random values between zero and one, with the same properties as Random.nextDouble() |
|
static Ops.DoubleGenerator |
doubleRandom(double bound)
Returns a generator producing uniform random values between zero and the given bound, with the same properties as Random.nextDouble() . |
|
static Ops.DoubleGenerator |
doubleRandom(double least,
double bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive) |
|
static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> |
equalityPredicate()
Returns a predicate evaluating to true if the first argument equals the second |
|
static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> |
identityPredicate()
Returns a predicate evaluating to true if the first argument == the second |
|
static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> |
inequalityPredicate()
Returns a predicate evaluating to true if the first argument ! |
|
static Ops.Predicate<java.lang.Object> |
instanceofPredicate(java.lang.Class type)
Returns a predicate evaluating to true if its argument is an instance of (see Class.isInstance(java.lang.Object) the given type (class). |
|
static Ops.IntReducer |
intAdder()
Returns a reducer that adds two int elements |
|
static Ops.BinaryIntPredicate |
intEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the second |
|
static Ops.BinaryIntPredicate |
intInequalityPredicate()
Returns a predicate evaluating to true if the first argument ! |
|
static Ops.IntGenerator |
intRandom()
Returns a generator producing uniform random values with the same properties as Random.nextInt() |
|
static Ops.IntGenerator |
intRandom(int bound)
Returns a generator producing uniform random values with the same properties as Random.nextInt(int) |
|
static Ops.IntGenerator |
intRandom(int least,
int bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive) |
|
static Ops.Predicate<java.lang.Object> |
isAssignablePredicate(java.lang.Class type)
Returns a predicate evaluating to true if its argument is assignable from (see Class.isAssignableFrom(java.lang.Class>) the given type (class). |
|
static Ops.Predicate<java.lang.Object> |
isNonNullPredicate()
Returns a predicate evaluating to true if its argument is non-null |
|
static Ops.Predicate<java.lang.Object> |
isNullPredicate()
Returns a predicate evaluating to true if its argument is null |
|
static Ops.LongReducer |
longAdder()
Returns a reducer that adds two long elements |
|
static Ops.BinaryLongPredicate |
longEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the second |
|
static Ops.BinaryLongPredicate |
longInequalityPredicate()
Returns a predicate evaluating to true if the first argument == the second |
|
static Ops.LongReducer |
longMaxReducer(Ops.LongComparator comparator)
Returns a reducer returning the maximum of two long elements, using the given comparator |
|
static Ops.LongReducer |
longMinReducer(Ops.LongComparator comparator)
Returns a reducer returning the minimum of two long elements, using the given comparator |
|
static Ops.LongGenerator |
longRandom()
Returns a generator producing uniform random values with the same properties as Random.nextLong() |
|
static Ops.LongGenerator |
longRandom(long bound)
Returns a generator producing uniform random values with the same properties as Random.nextInt(int) |
|
static Ops.LongGenerator |
longRandom(long least,
long bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive). |
|
static
|
maxReducer(java.util.Comparator<? super T> 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
|
minReducer(java.util.Comparator<? super T> 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
|
naturalComparator(java.lang.Class<T> type)
Returns a Comparator for Comparable objects |
|
static Ops.DoubleComparator |
naturalDoubleComparator()
Returns a comparator for doubles relying on natural ordering |
|
static Ops.DoubleReducer |
naturalDoubleMaxReducer()
Returns a reducer returning the maximum of two double elements, using natural comparator |
|
static Ops.DoubleReducer |
naturalDoubleMinReducer()
Returns a reducer returning the minimum of two double elements, using natural comparator |
|
static Ops.LongComparator |
naturalLongComparator()
Returns a comparator for longs relying on natural ordering |
|
static Ops.LongReducer |
naturalLongMaxReducer()
Returns a reducer returning the maximum of two long elements, using natural comparator |
|
static Ops.LongReducer |
naturalLongMinReducer()
A reducer returning the minimum of two long elements, using natural comparator |
|
static
|
naturalMaxReducer(java.lang.Class<T> type)
Returns a reducer returning the maximum of two Comparable elements, treating null as less than any non-null element. |
|
static
|
naturalMinReducer(java.lang.Class<T> type)
Returns a reducer returning the minimum of two Comparable elements, treating null as greater than any non-null element. |
|
static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> |
nonidentityPredicate()
Returns a predicate evaluating to true if the first argument ! |
|
static Ops.DoublePredicate |
notPredicate(Ops.DoublePredicate pred)
Returns a predicate evaluating to the negation of its contained predicate |
|
static Ops.LongPredicate |
notPredicate(Ops.LongPredicate pred)
Returns a predicate evaluating to the negation of its contained predicate |
|
static
|
notPredicate(Ops.Predicate<T> pred)
Returns a predicate evaluating to the negation of its contained predicate |
|
static Ops.DoublePredicate |
orPredicate(Ops.DoublePredicate first,
Ops.DoublePredicate second)
Returns a predicate evaluating to the disjunction of its contained predicates |
|
static Ops.LongPredicate |
orPredicate(Ops.LongPredicate first,
Ops.LongPredicate second)
Returns a predicate evaluating to the disjunction of its contained predicates |
|
static
|
orPredicate(Ops.Predicate<S> first,
Ops.Predicate<? super T> second)
Returns a predicate evaluating to the disjunction of its contained predicates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private CommonOps()
Method Detail |
---|
public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> naturalComparator(java.lang.Class<T> type)
public static <T extends java.lang.Comparable<? super T>> Ops.Reducer<T> naturalMaxReducer(java.lang.Class<T> type)
public static <T extends java.lang.Comparable<? super T>> Ops.Reducer<T> naturalMinReducer(java.lang.Class<T> type)
public static <T> Ops.Reducer<T> maxReducer(java.util.Comparator<? super T> comparator)
public static <T> Ops.Reducer<T> minReducer(java.util.Comparator<? super T> comparator)
public static java.util.Comparator<java.lang.Object> castedComparator()
public static Ops.Reducer<java.lang.Object> castedMaxReducer()
public static Ops.Reducer<java.lang.Object> castedMinReducer()
public static Ops.DoubleComparator naturalDoubleComparator()
public static Ops.DoubleReducer naturalDoubleMaxReducer()
public static Ops.DoubleReducer naturalDoubleMinReducer()
public static Ops.DoubleReducer doubleMaxReducer(Ops.DoubleComparator comparator)
public static Ops.DoubleReducer doubleMinReducer(Ops.DoubleComparator comparator)
public static Ops.LongComparator naturalLongComparator()
public static Ops.LongReducer naturalLongMaxReducer()
public static Ops.LongReducer naturalLongMinReducer()
public static Ops.LongReducer longMaxReducer(Ops.LongComparator comparator)
public static Ops.LongReducer longMinReducer(Ops.LongComparator comparator)
public static <T,U,V> Ops.Op<T,V> compoundOp(Ops.Op<? super T,? extends U> first, Ops.Op<? super U,? extends V> second)
public static <T,V> Ops.Op<T,V> compoundOp(Ops.ObjectToDouble<? super T> first, Ops.DoubleToObject<? extends V> second)
public static <T,V> Ops.Op<T,V> compoundOp(Ops.ObjectToLong<? super T> first, Ops.LongToObject<? extends V> second)
public static <T,V> Ops.DoubleToObject<V> compoundOp(Ops.DoubleToObject<? extends T> first, Ops.Op<? super T,? extends V> second)
public static <T,V> Ops.LongToObject<V> compoundOp(Ops.LongToObject<? extends T> first, Ops.Op<? super T,? extends V> second)
public static <T,U> Ops.ObjectToDouble<T> compoundOp(Ops.Op<? super T,? extends U> first, Ops.ObjectToDouble<? super U> second)
public static <T,U> Ops.ObjectToLong<T> compoundOp(Ops.Op<? super T,? extends U> first, Ops.ObjectToLong<? super U> second)
public static <T> Ops.ObjectToDouble<T> compoundOp(Ops.ObjectToDouble<? super T> first, Ops.DoubleOp second)
public static <T> Ops.ObjectToLong<T> compoundOp(Ops.ObjectToDouble<? super T> first, Ops.DoubleToLong second)
public static <T> Ops.ObjectToLong<T> compoundOp(Ops.ObjectToLong<? super T> first, Ops.LongOp second)
public static <T> Ops.ObjectToDouble<T> compoundOp(Ops.ObjectToLong<? super T> first, Ops.LongToDouble second)
public static Ops.DoubleOp compoundOp(Ops.DoubleOp first, Ops.DoubleOp second)
public static Ops.DoubleToLong compoundOp(Ops.DoubleOp first, Ops.DoubleToLong second)
public static Ops.DoubleToLong compoundOp(Ops.DoubleToLong first, Ops.LongOp second)
public static <T> Ops.DoubleToObject<T> compoundOp(Ops.DoubleToLong first, Ops.LongToObject<? extends T> second)
public static <T> Ops.LongToObject<T> compoundOp(Ops.LongToDouble first, Ops.DoubleToObject<? extends T> second)
public static Ops.LongToDouble compoundOp(Ops.LongOp first, Ops.LongToDouble second)
public static Ops.LongToDouble compoundOp(Ops.LongToDouble first, Ops.DoubleOp second)
public static <T> Ops.DoubleToObject<T> compoundOp(Ops.DoubleOp first, Ops.DoubleToObject<? extends T> second)
public static <T> Ops.LongToObject<T> compoundOp(Ops.LongOp first, Ops.LongToObject<? extends T> second)
public static <T> Ops.DoubleOp compoundOp(Ops.DoubleToObject<? extends T> first, Ops.ObjectToDouble<? super T> second)
public static <T> Ops.LongToDouble compoundOp(Ops.LongToObject<? extends T> first, Ops.ObjectToDouble<? super T> second)
public static <T> Ops.DoubleToLong compoundOp(Ops.DoubleToObject<? extends T> first, Ops.ObjectToLong<? super T> second)
public static <T> Ops.LongOp compoundOp(Ops.LongToObject<? extends T> first, Ops.ObjectToLong<? super T> second)
public static Ops.LongOp compoundOp(Ops.LongOp first, Ops.LongOp second)
public static Ops.DoubleOp compoundOp(Ops.DoubleToLong first, Ops.LongToDouble second)
public static Ops.LongOp compoundOp(Ops.LongToDouble first, Ops.DoubleToLong second)
public static <T> Ops.Predicate<T> notPredicate(Ops.Predicate<T> pred)
public static Ops.DoublePredicate notPredicate(Ops.DoublePredicate pred)
public static Ops.LongPredicate notPredicate(Ops.LongPredicate pred)
public static <S,T extends S> Ops.Predicate<T> andPredicate(Ops.Predicate<S> first, Ops.Predicate<? super T> second)
public static <S,T extends S> Ops.Predicate<T> orPredicate(Ops.Predicate<S> first, Ops.Predicate<? super T> second)
public static Ops.DoublePredicate andPredicate(Ops.DoublePredicate first, Ops.DoublePredicate second)
public static Ops.DoublePredicate orPredicate(Ops.DoublePredicate first, Ops.DoublePredicate second)
public static Ops.LongPredicate andPredicate(Ops.LongPredicate first, Ops.LongPredicate second)
public static Ops.LongPredicate orPredicate(Ops.LongPredicate first, Ops.LongPredicate second)
public static Ops.Predicate<java.lang.Object> isNonNullPredicate()
public static Ops.Predicate<java.lang.Object> isNullPredicate()
public static Ops.Predicate<java.lang.Object> instanceofPredicate(java.lang.Class type)
Class.isInstance(java.lang.Object)
the given type (class).
public static Ops.Predicate<java.lang.Object> isAssignablePredicate(java.lang.Class type)
Class.isAssignableFrom(java.lang.Class>)
the given type (class).
public static Ops.DoubleReducer doubleAdder()
public static Ops.LongReducer longAdder()
public static Ops.IntReducer intAdder()
public static Ops.DoubleGenerator doubleRandom()
Random.nextDouble()
public static Ops.DoubleGenerator doubleRandom(double bound)
Random.nextDouble()
.
bound
- the upper bound (exclusive) of opd valuespublic static Ops.DoubleGenerator doubleRandom(double least, double bound)
least
- the least value returnedbound
- the upper bound (exclusive) of opd valuespublic static Ops.LongGenerator longRandom()
Random.nextLong()
public static Ops.LongGenerator longRandom(long bound)
Random.nextInt(int)
bound
- the upper bound (exclusive) of opd valuespublic static Ops.LongGenerator longRandom(long least, long bound)
least
- the least value returnedbound
- the upper bound (exclusive) of opd valuespublic static Ops.IntGenerator intRandom()
Random.nextInt()
public static Ops.IntGenerator intRandom(int bound)
Random.nextInt(int)
bound
- the upper bound (exclusive) of opd valuespublic static Ops.IntGenerator intRandom(int least, int bound)
least
- the least value returnedbound
- the upper bound (exclusive) of opd valuespublic static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> equalityPredicate()
public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> identityPredicate()
public static Ops.BinaryIntPredicate intEqualityPredicate()
public static Ops.BinaryLongPredicate longEqualityPredicate()
public static Ops.BinaryDoublePredicate doubleEqualityPredicate()
public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> inequalityPredicate()
public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> nonidentityPredicate()
public static Ops.BinaryIntPredicate intInequalityPredicate()
public static Ops.BinaryLongPredicate longInequalityPredicate()
public static Ops.BinaryDoublePredicate doubleInequalityPredicate()
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |