jsr166y.forkjoin
Class Ops

java.lang.Object
  extended by jsr166y.forkjoin.Ops

public class Ops
extends java.lang.Object

Interfaces and utilities describing per-element operations used within parallel methods on aggregates. This class provides type names for common operation signatures accepting zero, one or two arguments, and returning zero or one results, for parameterized types, as well as specializations to long, and double. (Other scalar types like short are absent.)

In addition to stated signatures, implementations of these interfaces must work safely in parallel. In general, this means methods should operate only on their arguments, and should not rely on ThreadLocals, unsafely published globals, or other unsafe constructions. Additionally, they should not block waiting for synchronization.

This class also provides methods returning some commonly used implementations of some of these interfaces

This class is normally best used via import static.


Nested Class Summary
static interface Ops.Combiner<T,U,V>
          An object with a function accepting pairs of objects, one of type T and one of type U, returning those of type V
static interface Ops.DoubleComparator
          A Comparator for doubles
static interface Ops.DoubleGenerator
          A generator of doubles
static interface Ops.DoubleMapper
          A mapper accepting a double argument and returning a double
static interface Ops.DoublePredicate
          A predicate accepting a double argument
static interface Ops.DoubleProcedure
          A procedure accepting a double
static interface Ops.DoubleReducer
          A reducer accepting and returning doubles
static interface Ops.DoubleRelationalPredicate
          A relationalPredicate accepting double arguments
static interface Ops.Generator<T>
          A generator (builder) of objects of type T that takes no arguments.
static interface Ops.IntComparator
          A Comparator for ints
static interface Ops.IntGenerator
          A generator of ints
static interface Ops.IntMapper
          A map accepting an int and returning an int
static interface Ops.IntPredicate
          A predicate accepting an int
static interface Ops.IntProcedure
          A procedure accepting an int
static interface Ops.IntReducer
          A reducer accepting and returning ints
static interface Ops.IntRelationalPredicate
          A relationalPredicate accepting int arguments
static interface Ops.LongComparator
          A Comparator for longs
static interface Ops.LongGenerator
          A generator of longs
static interface Ops.LongMapper
          A mapper accepting a long argument and returning a long
static interface Ops.LongPredicate
          A predicate accepting a long argument
static interface Ops.LongProcedure
          A procedure accepting a long
static interface Ops.LongReducer
          A reducer accepting and returning longs
static interface Ops.LongRelationalPredicate
          A relationalPredicate accepting long arguments
static interface Ops.Mapper<T,U>
          An object with a function accepting objects of type T and returning those of type U
static interface Ops.MapperFromDouble<T>
          A mapper accepting a double
static interface Ops.MapperFromDoubleToInt
          A mapper accepting a double argument and returning an int
static interface Ops.MapperFromDoubleToLong
          A mapper accepting a double argument and returning a long
static interface Ops.MapperFromInt<T>
          A mapper accepting an int
static interface Ops.MapperFromIntToDouble
          A mapper accepting an int argument and returning a double
static interface Ops.MapperFromIntToLong
          A mapper accepting an int argument and returning a long
static interface Ops.MapperFromLong<T>
          A mapper accepting a long argument
static interface Ops.MapperFromLongToDouble
          A mapper accepting a long argument and returning a double
static interface Ops.MapperFromLongToInt
          A mapper accepting a long argument and returning an int
static interface Ops.MapperToDouble<T>
          A mapper returning a double
static interface Ops.MapperToInt<T>
          A mapper returning an int
static interface Ops.MapperToLong<T>
          A mapper returning a long
static interface Ops.Predicate<T>
          An object with boolean method of one argument
static interface Ops.Procedure<T>
          An object with a method of one argument that does not return a result.
static interface Ops.Reducer<T>
          A specialized combiner that is associative and accepts pairs of objects of the same type and returning one of the same type.
static interface Ops.RelationalPredicate<T,U>
          An object with boolean method of two arguments
 
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.DoubleMapper compoundMapper(Ops.DoubleMapper first, Ops.DoubleMapper second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperFromDouble<T>
compoundMapper(Ops.DoubleMapper first, Ops.MapperFromDouble<? extends T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.MapperFromDoubleToLong compoundMapper(Ops.DoubleMapper first, Ops.MapperFromDoubleToLong second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.LongMapper compoundMapper(Ops.LongMapper first, Ops.LongMapper second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperFromLong<T>
compoundMapper(Ops.LongMapper first, Ops.MapperFromLong<? extends T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.MapperFromLongToDouble compoundMapper(Ops.LongMapper first, Ops.MapperFromLongToDouble second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,U,V> Ops.Mapper<T,V>
compoundMapper(Ops.Mapper<? super T,? extends U> first, Ops.Mapper<? super U,? extends V> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,U> Ops.MapperToDouble<T>
compoundMapper(Ops.Mapper<? super T,? extends U> first, Ops.MapperToDouble<? super U> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,U> Ops.MapperToLong<T>
compoundMapper(Ops.Mapper<? super T,? extends U> first, Ops.MapperToLong<? super U> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,V> Ops.MapperFromDouble<V>
compoundMapper(Ops.MapperFromDouble<? extends T> first, Ops.Mapper<? 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.DoubleMapper
compoundMapper(Ops.MapperFromDouble<? extends T> first, Ops.MapperToDouble<? super T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperFromDoubleToLong
compoundMapper(Ops.MapperFromDouble<? extends T> first, Ops.MapperToLong<? super T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.MapperFromDoubleToLong compoundMapper(Ops.MapperFromDoubleToLong first, Ops.LongMapper second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperFromDouble<T>
compoundMapper(Ops.MapperFromDoubleToLong first, Ops.MapperFromLong<? extends T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.DoubleMapper compoundMapper(Ops.MapperFromDoubleToLong first, Ops.MapperFromLongToDouble second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,V> Ops.MapperFromLong<V>
compoundMapper(Ops.MapperFromLong<? extends T> first, Ops.Mapper<? 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.MapperFromLongToDouble
compoundMapper(Ops.MapperFromLong<? extends T> first, Ops.MapperToDouble<? super T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.LongMapper
compoundMapper(Ops.MapperFromLong<? extends T> first, Ops.MapperToLong<? super T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.MapperFromLongToDouble compoundMapper(Ops.MapperFromLongToDouble first, Ops.DoubleMapper second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperFromLong<T>
compoundMapper(Ops.MapperFromLongToDouble first, Ops.MapperFromDouble<? extends T> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static Ops.LongMapper compoundMapper(Ops.MapperFromLongToDouble first, Ops.MapperFromDoubleToLong second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperToDouble<T>
compoundMapper(Ops.MapperToDouble<? super T> first, Ops.DoubleMapper second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,V> Ops.Mapper<T,V>
compoundMapper(Ops.MapperToDouble<? super T> first, Ops.MapperFromDouble<? extends V> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperToLong<T>
compoundMapper(Ops.MapperToDouble<? super T> first, Ops.MapperFromDoubleToLong second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperToLong<T>
compoundMapper(Ops.MapperToLong<? super T> first, Ops.LongMapper second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T,V> Ops.Mapper<T,V>
compoundMapper(Ops.MapperToLong<? super T> first, Ops.MapperFromLong<? extends V> second)
          Returns a composite mapper that applies a second mapper to the results of applying the first one
static
<T> Ops.MapperToDouble<T>
compoundMapper(Ops.MapperToLong<? super T> first, Ops.MapperFromLongToDouble 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.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() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
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() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
static Ops.DoubleGenerator doubleRandom(double least, double bound)
          Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive), operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
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.IntGenerator intRandom()
          Returns a generator producing uniform random values with the same properties as Random.nextInt() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
static Ops.IntGenerator intRandom(int bound)
          Returns a generator producing uniform random values with the same properties as Random.nextInt(int) but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
static Ops.IntGenerator intRandom(int least, int bound)
          Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive), operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
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.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() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
static Ops.LongGenerator longRandom(long bound)
          Returns a generator producing uniform random values with the same properties as Random.nextInt(int) but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
static Ops.LongGenerator longRandom(long least, long bound)
          Returns a generator producing uniform random values between the given least value (inclusive) and bound (exclusive), operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.
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.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 disjuntion of its contained predicates
static Ops.LongPredicate orPredicate(Ops.LongPredicate first, Ops.LongPredicate second)
          Returns a predicate evaluating to the disjuntion 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 disjuntion of its contained predicates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


compoundMapper

public static <T,U,V> Ops.Mapper<T,V> compoundMapper(Ops.Mapper<? super T,? extends U> first,
                                                     Ops.Mapper<? super U,? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T,V> Ops.Mapper<T,V> compoundMapper(Ops.MapperToDouble<? super T> first,
                                                   Ops.MapperFromDouble<? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T,V> Ops.Mapper<T,V> compoundMapper(Ops.MapperToLong<? super T> first,
                                                   Ops.MapperFromLong<? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T,V> Ops.MapperFromDouble<V> compoundMapper(Ops.MapperFromDouble<? extends T> first,
                                                           Ops.Mapper<? super T,? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T,V> Ops.MapperFromLong<V> compoundMapper(Ops.MapperFromLong<? extends T> first,
                                                         Ops.Mapper<? super T,? extends V> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T,U> Ops.MapperToDouble<T> compoundMapper(Ops.Mapper<? super T,? extends U> first,
                                                         Ops.MapperToDouble<? super U> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T,U> Ops.MapperToLong<T> compoundMapper(Ops.Mapper<? super T,? extends U> first,
                                                       Ops.MapperToLong<? super U> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperToDouble<T> compoundMapper(Ops.MapperToDouble<? super T> first,
                                                       Ops.DoubleMapper second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperToLong<T> compoundMapper(Ops.MapperToDouble<? super T> first,
                                                     Ops.MapperFromDoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperToLong<T> compoundMapper(Ops.MapperToLong<? super T> first,
                                                     Ops.LongMapper second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperToDouble<T> compoundMapper(Ops.MapperToLong<? super T> first,
                                                       Ops.MapperFromLongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.DoubleMapper compoundMapper(Ops.DoubleMapper first,
                                              Ops.DoubleMapper second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.MapperFromDoubleToLong compoundMapper(Ops.DoubleMapper first,
                                                        Ops.MapperFromDoubleToLong second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.MapperFromDoubleToLong compoundMapper(Ops.MapperFromDoubleToLong first,
                                                        Ops.LongMapper second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperFromDouble<T> compoundMapper(Ops.MapperFromDoubleToLong first,
                                                         Ops.MapperFromLong<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperFromLong<T> compoundMapper(Ops.MapperFromLongToDouble first,
                                                       Ops.MapperFromDouble<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.MapperFromLongToDouble compoundMapper(Ops.LongMapper first,
                                                        Ops.MapperFromLongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.MapperFromLongToDouble compoundMapper(Ops.MapperFromLongToDouble first,
                                                        Ops.DoubleMapper second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperFromDouble<T> compoundMapper(Ops.DoubleMapper first,
                                                         Ops.MapperFromDouble<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperFromLong<T> compoundMapper(Ops.LongMapper first,
                                                       Ops.MapperFromLong<? extends T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.DoubleMapper compoundMapper(Ops.MapperFromDouble<? extends T> first,
                                                  Ops.MapperToDouble<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperFromLongToDouble compoundMapper(Ops.MapperFromLong<? extends T> first,
                                                            Ops.MapperToDouble<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.MapperFromDoubleToLong compoundMapper(Ops.MapperFromDouble<? extends T> first,
                                                            Ops.MapperToLong<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static <T> Ops.LongMapper compoundMapper(Ops.MapperFromLong<? extends T> first,
                                                Ops.MapperToLong<? super T> second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.LongMapper compoundMapper(Ops.LongMapper first,
                                            Ops.LongMapper second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.DoubleMapper compoundMapper(Ops.MapperFromDoubleToLong first,
                                              Ops.MapperFromLongToDouble second)
Returns a composite mapper that applies a second mapper to the results of applying the first one


compoundMapper

public static Ops.LongMapper compoundMapper(Ops.MapperFromLongToDouble first,
                                            Ops.MapperFromDoubleToLong 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 disjuntion 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 disjuntion 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 disjuntion 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() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.


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() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.

Parameters:
bound - the upper bound (exclusive) of generated 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), operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.

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

longRandom

public static Ops.LongGenerator longRandom()
Returns a generator producing uniform random values with the same properties as Random.nextLong() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.


longRandom

public static Ops.LongGenerator longRandom(long bound)
Returns a generator producing uniform random values with the same properties as Random.nextInt(int) but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.

Parameters:
bound - the upper bound (exclusive) of generated 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), operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.

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

intRandom

public static Ops.IntGenerator intRandom()
Returns a generator producing uniform random values with the same properties as Random.nextInt() but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.


intRandom

public static Ops.IntGenerator intRandom(int bound)
Returns a generator producing uniform random values with the same properties as Random.nextInt(int) but operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.

Parameters:
bound - the upper bound (exclusive) of generated 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), operating independently across ForkJoinWorkerThreads and usable only within forkjoin computations.

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