Package extra166y
Class CommonOps
- java.lang.Object
-
- extra166y.CommonOps
-
public class CommonOps extends java.lang.Object
A collection of static factory methods providing commonly useful implementations of operations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Ops.DoublePredicate
andPredicate(Ops.DoublePredicate first, Ops.DoublePredicate second)
Returns a predicate evaluating to the conjunction of its contained predicatesstatic Ops.LongPredicate
andPredicate(Ops.LongPredicate first, Ops.LongPredicate second)
Returns a predicate evaluating to the conjunction of its contained predicatesstatic <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 predicatesstatic 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 onestatic 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 onestatic <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 onestatic 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 onestatic 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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic 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 onestatic 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 onestatic <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 onestatic 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 onestatic 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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic <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 onestatic Ops.DoubleReducer
doubleAdder()
Returns a reducer that adds two double elementsstatic Ops.BinaryDoublePredicate
doubleEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the secondstatic Ops.BinaryDoublePredicate
doubleInequalityPredicate()
Returns a predicate evaluating to true if the first argument != the secondstatic Ops.DoubleReducer
doubleMaxReducer(Ops.DoubleComparator comparator)
Returns a reducer returning the maximum of two double elements, using the given comparatorstatic Ops.DoubleReducer
doubleMinReducer(Ops.DoubleComparator comparator)
Returns a reducer returning the minimum of two double elements, using the given comparatorstatic Ops.DoubleGenerator
doubleRandom()
Returns a generator producing uniform random values between zero and one, with the same properties asRandom.nextDouble()
static Ops.DoubleGenerator
doubleRandom(double bound)
Returns a generator producing uniform random values between zero and the given bound, with the same properties asRandom.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 secondstatic Ops.BinaryPredicate<java.lang.Object,java.lang.Object>
identityPredicate()
Returns a predicate evaluating to true if the first argument == the secondstatic Ops.BinaryPredicate<java.lang.Object,java.lang.Object>
inequalityPredicate()
Returns a predicate evaluating to true if the first argument !equals the secondstatic Ops.Predicate<java.lang.Object>
instanceofPredicate(java.lang.Class type)
Returns a predicate evaluating to true if its argument is an instance of (seeClass.isInstance(java.lang.Object)
the given type (class).static Ops.IntReducer
intAdder()
Returns a reducer that adds two int elementsstatic Ops.BinaryIntPredicate
intEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the secondstatic Ops.BinaryIntPredicate
intInequalityPredicate()
Returns a predicate evaluating to true if the first argument != the secondstatic Ops.IntGenerator
intRandom()
Returns a generator producing uniform random values with the same properties asRandom.nextInt()
static Ops.IntGenerator
intRandom(int bound)
Returns a generator producing uniform random values with the same properties asRandom.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 (seeClass.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-nullstatic Ops.Predicate<java.lang.Object>
isNullPredicate()
Returns a predicate evaluating to true if its argument is nullstatic Ops.LongReducer
longAdder()
Returns a reducer that adds two long elementsstatic Ops.BinaryLongPredicate
longEqualityPredicate()
Returns a predicate evaluating to true if the first argument == the secondstatic Ops.BinaryLongPredicate
longInequalityPredicate()
Returns a predicate evaluating to true if the first argument == the secondstatic Ops.LongReducer
longMaxReducer(Ops.LongComparator comparator)
Returns a reducer returning the maximum of two long elements, using the given comparatorstatic Ops.LongReducer
longMinReducer(Ops.LongComparator comparator)
Returns a reducer returning the minimum of two long elements, using the given comparatorstatic Ops.LongGenerator
longRandom()
Returns a generator producing uniform random values with the same properties asRandom.nextLong()
static Ops.LongGenerator
longRandom(long bound)
Returns a generator producing uniform random values with the same properties asRandom.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 objectsstatic Ops.DoubleComparator
naturalDoubleComparator()
Returns a comparator for doubles relying on natural orderingstatic Ops.DoubleReducer
naturalDoubleMaxReducer()
Returns a reducer returning the maximum of two double elements, using natural comparatorstatic Ops.DoubleReducer
naturalDoubleMinReducer()
Returns a reducer returning the minimum of two double elements, using natural comparatorstatic Ops.LongComparator
naturalLongComparator()
Returns a comparator for longs relying on natural orderingstatic Ops.LongReducer
naturalLongMaxReducer()
Returns a reducer returning the maximum of two long elements, using natural comparatorstatic Ops.LongReducer
naturalLongMinReducer()
A reducer returning the minimum of two long elements, using natural comparatorstatic <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 != the secondstatic Ops.DoublePredicate
notPredicate(Ops.DoublePredicate pred)
Returns a predicate evaluating to the negation of its contained predicatestatic Ops.LongPredicate
notPredicate(Ops.LongPredicate pred)
Returns a predicate evaluating to the negation of its contained predicatestatic <T> Ops.Predicate<T>
notPredicate(Ops.Predicate<T> pred)
Returns a predicate evaluating to the negation of its contained predicatestatic Ops.DoublePredicate
orPredicate(Ops.DoublePredicate first, Ops.DoublePredicate second)
Returns a predicate evaluating to the disjunction of its contained predicatesstatic Ops.LongPredicate
orPredicate(Ops.LongPredicate first, Ops.LongPredicate second)
Returns a predicate evaluating to the disjunction of its contained predicatesstatic <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
-
-
-
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 (seeClass.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 (seeClass.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 asRandom.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 asRandom.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 returnedbound
- the upper bound (exclusive) of opd values
-
longRandom
public static Ops.LongGenerator longRandom()
Returns a generator producing uniform random values with the same properties asRandom.nextLong()
-
longRandom
public static Ops.LongGenerator longRandom(long bound)
Returns a generator producing uniform random values with the same properties asRandom.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 returnedbound
- the upper bound (exclusive) of opd values
-
intRandom
public static Ops.IntGenerator intRandom()
Returns a generator producing uniform random values with the same properties asRandom.nextInt()
-
intRandom
public static Ops.IntGenerator intRandom(int bound)
Returns a generator producing uniform random values with the same properties asRandom.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 returnedbound
- 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
-
-