groovyx.gpars.extra166y
Class CommonOps

java.lang.Object
  extended by groovyx.gpars.extra166y.CommonOps

public class CommonOps
extends java.lang.Object

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
<S,T extends S>
Ops.Predicate<T>
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
<T> Ops.DoubleToObject<T>
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
<T> Ops.DoubleToObject<T>
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
<T> Ops.DoubleOp
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
<T> Ops.DoubleToLong
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
<T,V> Ops.DoubleToObject<V>
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
<T> Ops.LongToObject<T>
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
<T> Ops.LongToObject<T>
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
<T> Ops.LongToDouble
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
<T> Ops.LongOp
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
<T,V> Ops.LongToObject<V>
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
<T> Ops.ObjectToDouble<T>
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
<T> Ops.ObjectToLong<T>
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
<T,V> Ops.Op<T,V>
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
<T> Ops.ObjectToLong<T>
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
<T> Ops.ObjectToDouble<T>
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
<T,V> Ops.Op<T,V>
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
<T,U> Ops.ObjectToDouble<T>
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
<T,U> Ops.ObjectToLong<T>
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
<T,U,V> Ops.Op<T,V>
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
<T> Ops.Reducer<T>
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
<T> Ops.Reducer<T>
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
<T extends java.lang.Comparable<? super T>>
java.util.Comparator<T>
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
<T extends java.lang.Comparable<? super T>>
Ops.Reducer<T>
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
<T extends java.lang.Comparable<? super T>>
Ops.Reducer<T>
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
<T> Ops.Predicate<T>
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
<S,T extends S>
Ops.Predicate<T>
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

CommonOps

private CommonOps()
Method Detail

naturalComparator

public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> naturalComparator(java.lang.Class<T> type)
Returns a Comparator for Comparable objects


naturalMaxReducer

public static <T extends java.lang.Comparable<? super T>> Ops.Reducer<T> 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.


naturalMinReducer

public static <T extends java.lang.Comparable<? super T>> Ops.Reducer<T> 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.


maxReducer

public static <T> Ops.Reducer<T> 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.


minReducer

public static <T> Ops.Reducer<T> 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.


castedComparator

public static java.util.Comparator<java.lang.Object> castedComparator()
Returns a Comparator that casts its arguments as Comparable on each comparison, throwing ClassCastException on failure.


castedMaxReducer

public 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.


castedMinReducer

public 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.


naturalDoubleComparator

public static Ops.DoubleComparator naturalDoubleComparator()
Returns a comparator for doubles relying on natural ordering


naturalDoubleMaxReducer

public static Ops.DoubleReducer naturalDoubleMaxReducer()
Returns a reducer returning the maximum of two double elements, using natural comparator


naturalDoubleMinReducer

public static Ops.DoubleReducer naturalDoubleMinReducer()
Returns a reducer returning the minimum of two double elements, using natural comparator


doubleMaxReducer

public static Ops.DoubleReducer doubleMaxReducer(Ops.DoubleComparator comparator)
Returns a reducer returning the maximum of two double elements, using the given comparator


doubleMinReducer

public static Ops.DoubleReducer doubleMinReducer(Ops.DoubleComparator comparator)
Returns a reducer returning the minimum of two double elements, using the given comparator


naturalLongComparator

public static Ops.LongComparator naturalLongComparator()
Returns a comparator for longs relying on natural ordering


naturalLongMaxReducer

public static Ops.LongReducer naturalLongMaxReducer()
Returns a reducer returning the maximum of two long elements, using natural comparator


naturalLongMinReducer

public static Ops.LongReducer naturalLongMinReducer()
A reducer returning the minimum of two long elements, using natural comparator


longMaxReducer

public static Ops.LongReducer longMaxReducer(Ops.LongComparator comparator)
Returns a reducer returning the maximum of two long elements, using the given comparator


longMinReducer

public static Ops.LongReducer longMinReducer(Ops.LongComparator comparator)
Returns a reducer returning the minimum of two long elements, using the given comparator


compoundOp

public static <T,U,V> Ops.Op<T,V> 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


compoundOp

public static <T,V> Ops.Op<T,V> 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


compoundOp

public static <T,V> Ops.Op<T,V> 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


compoundOp

public static <T,V> Ops.DoubleToObject<V> 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


compoundOp

public static <T,V> Ops.LongToObject<V> 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


compoundOp

public static <T,U> Ops.ObjectToDouble<T> 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


compoundOp

public static <T,U> Ops.ObjectToLong<T> 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


compoundOp

public static <T> Ops.ObjectToDouble<T> 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


compoundOp

public static <T> Ops.ObjectToLong<T> 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


compoundOp

public static <T> Ops.ObjectToLong<T> 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


compoundOp

public static <T> Ops.ObjectToDouble<T> 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


compoundOp

public 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


compoundOp

public 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


compoundOp

public 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


compoundOp

public static <T> Ops.DoubleToObject<T> 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


compoundOp

public static <T> Ops.LongToObject<T> 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


compoundOp

public 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


compoundOp

public 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


compoundOp

public static <T> Ops.DoubleToObject<T> 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


compoundOp

public static <T> Ops.LongToObject<T> 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


compoundOp

public static <T> Ops.DoubleOp 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


compoundOp

public static <T> Ops.LongToDouble 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


compoundOp

public static <T> Ops.DoubleToLong 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


compoundOp

public static <T> Ops.LongOp 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


compoundOp

public 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


compoundOp

public 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


compoundOp

public 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


notPredicate

public static <T> Ops.Predicate<T> notPredicate(Ops.Predicate<T> pred)
Returns a predicate evaluating to the negation of its contained predicate


notPredicate

public static Ops.DoublePredicate notPredicate(Ops.DoublePredicate pred)
Returns a predicate evaluating to the negation of its contained predicate


notPredicate

public static Ops.LongPredicate notPredicate(Ops.LongPredicate pred)
Returns a predicate evaluating to the negation of its contained predicate


andPredicate

public static <S,T extends S> Ops.Predicate<T> andPredicate(Ops.Predicate<S> first,
                                                            Ops.Predicate<? super T> second)
Returns a predicate evaluating to the conjunction of its contained predicates


orPredicate

public static <S,T extends S> Ops.Predicate<T> orPredicate(Ops.Predicate<S> first,
                                                           Ops.Predicate<? super T> second)
Returns a predicate evaluating to the disjunction of its contained predicates


andPredicate

public static Ops.DoublePredicate andPredicate(Ops.DoublePredicate first,
                                               Ops.DoublePredicate second)
Returns a predicate evaluating to the conjunction of its contained predicates


orPredicate

public static Ops.DoublePredicate orPredicate(Ops.DoublePredicate first,
                                              Ops.DoublePredicate second)
Returns a predicate evaluating to the disjunction of its contained predicates


andPredicate

public static Ops.LongPredicate andPredicate(Ops.LongPredicate first,
                                             Ops.LongPredicate second)
Returns a predicate evaluating to the conjunction of its contained predicates


orPredicate

public static Ops.LongPredicate orPredicate(Ops.LongPredicate first,
                                            Ops.LongPredicate second)
Returns a predicate evaluating to the disjunction of its contained predicates


isNonNullPredicate

public static Ops.Predicate<java.lang.Object> isNonNullPredicate()
Returns a predicate evaluating to true if its argument is non-null


isNullPredicate

public static Ops.Predicate<java.lang.Object> isNullPredicate()
Returns a predicate evaluating to true if its argument is null


instanceofPredicate

public 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).


isAssignablePredicate

public 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).


doubleAdder

public static Ops.DoubleReducer doubleAdder()
Returns a reducer that adds two double elements


longAdder

public static Ops.LongReducer longAdder()
Returns a reducer that adds two long elements


intAdder

public static Ops.IntReducer intAdder()
Returns a reducer that adds two int elements


doubleRandom

public static Ops.DoubleGenerator doubleRandom()
Returns a generator producing uniform random values between zero and one, with the same properties as Random.nextDouble()


doubleRandom

public 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().

Parameters:
bound - the upper bound (exclusive) of opd values

doubleRandom

public static Ops.DoubleGenerator doubleRandom(double least,
                                               double bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive)

Parameters:
least - the least value returned
bound - the upper bound (exclusive) of opd values

longRandom

public static Ops.LongGenerator longRandom()
Returns a generator producing uniform random values with the same properties as Random.nextLong()


longRandom

public static Ops.LongGenerator longRandom(long bound)
Returns a generator producing uniform random values with the same properties as Random.nextInt(int)

Parameters:
bound - the upper bound (exclusive) of opd values

longRandom

public static Ops.LongGenerator longRandom(long least,
                                           long bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive).

Parameters:
least - the least value returned
bound - the upper bound (exclusive) of opd values

intRandom

public static Ops.IntGenerator intRandom()
Returns a generator producing uniform random values with the same properties as Random.nextInt()


intRandom

public static Ops.IntGenerator intRandom(int bound)
Returns a generator producing uniform random values with the same properties as Random.nextInt(int)

Parameters:
bound - the upper bound (exclusive) of opd values

intRandom

public static Ops.IntGenerator intRandom(int least,
                                         int bound)
Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive)

Parameters:
least - the least value returned
bound - the upper bound (exclusive) of opd values

equalityPredicate

public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> equalityPredicate()
Returns a predicate evaluating to true if the first argument equals the second


identityPredicate

public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> identityPredicate()
Returns a predicate evaluating to true if the first argument == the second


intEqualityPredicate

public static Ops.BinaryIntPredicate intEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the second


longEqualityPredicate

public static Ops.BinaryLongPredicate longEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the second


doubleEqualityPredicate

public static Ops.BinaryDoublePredicate doubleEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the second


inequalityPredicate

public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> inequalityPredicate()
Returns a predicate evaluating to true if the first argument !equals the second


nonidentityPredicate

public static Ops.BinaryPredicate<java.lang.Object,java.lang.Object> nonidentityPredicate()
Returns a predicate evaluating to true if the first argument != the second


intInequalityPredicate

public static Ops.BinaryIntPredicate intInequalityPredicate()
Returns a predicate evaluating to true if the first argument != the second


longInequalityPredicate

public static Ops.BinaryLongPredicate longInequalityPredicate()
Returns a predicate evaluating to true if the first argument == the second


doubleInequalityPredicate

public static Ops.BinaryDoublePredicate doubleInequalityPredicate()
Returns a predicate evaluating to true if the first argument != the second


Copyright © 2008–2012 Václav Pech. All Rights Reserved.