--- jsr166/src/extra166y/CommonOps.java 2011/12/05 04:08:47 1.5 +++ jsr166/src/extra166y/CommonOps.java 2015/01/18 20:17:32 1.8 @@ -5,6 +5,7 @@ */ package extra166y; + import jsr166y.*; import static extra166y.Ops.*; import java.util.*; @@ -17,7 +18,7 @@ public class CommonOps { private CommonOps() {} // disable construction /** - * Returns a Comparator for Comparable objects + * Returns a Comparator for Comparable objects. */ public static > Comparator naturalComparator(Class type) { @@ -100,7 +101,7 @@ public class CommonOps { /** * Returns a reducer returning maximum of two values, or - * null if both arguments are null, and that casts + * {@code null} if both arguments are null, and that casts * its arguments as Comparable on each comparison, throwing * ClassCastException on failure. */ @@ -118,7 +119,7 @@ public class CommonOps { /** * Returns a reducer returning minimum of two values, or - * null if both arguments are null, and that casts + * {@code null} if both arguments are null, and that casts * its arguments as Comparable on each comparison, throwing * ClassCastException on failure. */ @@ -136,7 +137,7 @@ public class CommonOps { /** - * Returns a comparator for doubles relying on natural ordering + * Returns a comparator for doubles relying on natural ordering. */ public static DoubleComparator naturalDoubleComparator() { return NaturalDoubleComparator.comparator; @@ -152,7 +153,7 @@ public class CommonOps { /** * Returns a reducer returning the maximum of two double elements, - * using natural comparator + * using natural comparator. */ public static DoubleReducer naturalDoubleMaxReducer() { return NaturalDoubleMaxReducer.max; @@ -167,7 +168,7 @@ public class CommonOps { /** * Returns a reducer returning the minimum of two double elements, - * using natural comparator + * using natural comparator. */ public static DoubleReducer naturalDoubleMinReducer() { return NaturalDoubleMinReducer.min; @@ -181,7 +182,7 @@ public class CommonOps { /** * Returns a reducer returning the maximum of two double elements, - * using the given comparator + * using the given comparator. */ public static DoubleReducer doubleMaxReducer (final DoubleComparator comparator) { @@ -194,7 +195,7 @@ public class CommonOps { /** * Returns a reducer returning the minimum of two double elements, - * using the given comparator + * using the given comparator. */ public static DoubleReducer doubleMinReducer (final DoubleComparator comparator) { @@ -206,7 +207,7 @@ public class CommonOps { } /** - * Returns a comparator for longs relying on natural ordering + * Returns a comparator for longs relying on natural ordering. */ public static LongComparator naturalLongComparator() { return NaturalLongComparator.comparator; @@ -222,7 +223,7 @@ public class CommonOps { /** * Returns a reducer returning the maximum of two long elements, - * using natural comparator + * using natural comparator. */ public static LongReducer naturalLongMaxReducer() { return NaturalLongMaxReducer.max; @@ -237,7 +238,7 @@ public class CommonOps { /** * A reducer returning the minimum of two long elements, - * using natural comparator + * using natural comparator. */ public static LongReducer naturalLongMinReducer() { return NaturalLongMinReducer.min; @@ -251,7 +252,7 @@ public class CommonOps { /** * Returns a reducer returning the maximum of two long elements, - * using the given comparator + * using the given comparator. */ public static LongReducer longMaxReducer (final LongComparator comparator) { @@ -264,7 +265,7 @@ public class CommonOps { /** * Returns a reducer returning the minimum of two long elements, - * using the given comparator + * using the given comparator. */ public static LongReducer longMinReducer (final LongComparator comparator) { @@ -277,7 +278,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static Op compoundOp (final Op first, @@ -289,7 +290,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static Op compoundOp (final ObjectToDouble first, @@ -301,7 +302,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static Op compoundOp (final ObjectToLong first, @@ -313,7 +314,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleToObject compoundOp (final DoubleToObject first, @@ -325,7 +326,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongToObject compoundOp (final LongToObject first, @@ -337,7 +338,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static ObjectToDouble compoundOp (final Op first, @@ -349,7 +350,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static ObjectToLong compoundOp (final Op first, @@ -361,7 +362,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static ObjectToDouble compoundOp (final ObjectToDouble first, @@ -373,7 +374,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static ObjectToLong compoundOp (final ObjectToDouble first, @@ -385,7 +386,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static ObjectToLong compoundOp (final ObjectToLong first, @@ -397,7 +398,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static ObjectToDouble compoundOp (final ObjectToLong first, @@ -409,7 +410,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleOp compoundOp (final DoubleOp first, @@ -421,7 +422,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleToLong compoundOp (final DoubleOp first, @@ -433,7 +434,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleToLong compoundOp (final DoubleToLong first, @@ -445,7 +446,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleToObject compoundOp (final DoubleToLong first, @@ -457,7 +458,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongToObject compoundOp (final LongToDouble first, @@ -469,7 +470,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongToDouble compoundOp (final LongOp first, @@ -481,7 +482,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongToDouble compoundOp (final LongToDouble first, @@ -493,7 +494,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleToObject compoundOp (final DoubleOp first, @@ -505,7 +506,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongToObject compoundOp (final LongOp first, @@ -517,7 +518,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleOp compoundOp (final DoubleToObject first, @@ -529,7 +530,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongToDouble compoundOp (final LongToObject first, @@ -541,7 +542,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleToLong compoundOp (final DoubleToObject first, @@ -553,7 +554,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongOp compoundOp (final LongToObject first, @@ -565,7 +566,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongOp compoundOp (final LongOp first, @@ -577,7 +578,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static DoubleOp compoundOp (final DoubleToLong first, @@ -589,7 +590,7 @@ public class CommonOps { /** * Returns a composite mapper that applies a second mapper to the results - * of applying the first one + * of applying the first one. */ public static LongOp compoundOp (final LongToDouble first, @@ -600,7 +601,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the negation of its contained predicate + * Returns a predicate evaluating to the negation of its contained predicate. */ public static Predicate notPredicate (final Predicate pred) { @@ -610,7 +611,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the negation of its contained predicate + * Returns a predicate evaluating to the negation of its contained predicate. */ public static DoublePredicate notPredicate (final DoublePredicate pred) { @@ -620,7 +621,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the negation of its contained predicate + * Returns a predicate evaluating to the negation of its contained predicate. */ public static LongPredicate notPredicate (final LongPredicate pred) { @@ -630,7 +631,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the conjunction of its contained predicates + * Returns a predicate evaluating to the conjunction of its contained predicates. */ public static Predicate andPredicate (final Predicate first, @@ -643,7 +644,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the disjunction of its contained predicates + * Returns a predicate evaluating to the disjunction of its contained predicates. */ public static Predicate orPredicate (final Predicate first, @@ -656,7 +657,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the conjunction of its contained predicates + * Returns a predicate evaluating to the conjunction of its contained predicates. */ public static DoublePredicate andPredicate (final DoublePredicate first, @@ -669,7 +670,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the disjunction of its contained predicates + * Returns a predicate evaluating to the disjunction of its contained predicates. */ public static DoublePredicate orPredicate (final DoublePredicate first, @@ -683,7 +684,7 @@ public class CommonOps { /** - * Returns a predicate evaluating to the conjunction of its contained predicates + * Returns a predicate evaluating to the conjunction of its contained predicates. */ public static LongPredicate andPredicate (final LongPredicate first, @@ -696,7 +697,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to the disjunction of its contained predicates + * Returns a predicate evaluating to the disjunction of its contained predicates. */ public static LongPredicate orPredicate (final LongPredicate first, @@ -709,7 +710,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to true if its argument is non-null + * Returns a predicate evaluating to true if its argument is non-null. */ public static Predicate isNonNullPredicate() { return IsNonNullPredicate.predicate; @@ -723,7 +724,7 @@ public class CommonOps { } /** - * Returns a predicate evaluating to true if its argument is null + * Returns a predicate evaluating to true if its argument is null. */ public static Predicate isNullPredicate() { return IsNullPredicate.predicate; @@ -761,7 +762,7 @@ public class CommonOps { } /** - * Returns a reducer that adds two double elements + * Returns a reducer that adds two double elements. */ public static DoubleReducer doubleAdder() { return DoubleAdder.adder; } static final class DoubleAdder implements DoubleReducer { @@ -770,7 +771,7 @@ public class CommonOps { } /** - * Returns a reducer that adds two long elements + * Returns a reducer that adds two long elements. */ public static LongReducer longAdder() { return LongAdder.adder; } static final class LongAdder implements LongReducer { @@ -779,7 +780,7 @@ public class CommonOps { } /** - * Returns a reducer that adds two int elements + * Returns a reducer that adds two int elements. */ public static IntReducer intAdder() { return IntAdder.adder; } static final class IntAdder implements IntReducer { @@ -790,7 +791,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values between * zero and one, with the same properties as {@link - * java.util.Random#nextDouble} + * java.util.Random#nextDouble}. */ public static DoubleGenerator doubleRandom() { return DoubleRandomGenerator.generator; @@ -822,7 +823,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values between the - * given least value (inclusive) and bound (exclusive) + * given least value (inclusive) and bound (exclusive). * @param least the least value returned * @param bound the upper bound (exclusive) of opd values */ @@ -842,7 +843,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values with the - * same properties as {@link java.util.Random#nextLong} + * same properties as {@link java.util.Random#nextLong}. */ public static LongGenerator longRandom() { return LongRandomGenerator.generator; @@ -857,7 +858,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values with the - * same properties as {@link java.util.Random#nextInt(int)} + * same properties as {@link java.util.Random#nextInt(int)}. * @param bound the upper bound (exclusive) of opd values */ public static LongGenerator longRandom(long bound) { @@ -897,7 +898,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values with the - * same properties as {@link java.util.Random#nextInt} + * same properties as {@link java.util.Random#nextInt}. */ public static IntGenerator intRandom() { return IntRandomGenerator.generator; @@ -912,7 +913,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values with the - * same properties as {@link java.util.Random#nextInt(int)} + * same properties as {@link java.util.Random#nextInt(int)}. * @param bound the upper bound (exclusive) of opd values */ public static IntGenerator intRandom(int bound) { @@ -930,7 +931,7 @@ public class CommonOps { /** * Returns a generator producing uniform random values between the - * given least value (inclusive) and bound (exclusive) + * given least value (inclusive) and bound (exclusive). * @param least the least value returned * @param bound the upper bound (exclusive) of opd values */ @@ -952,7 +953,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument equals the second + * first argument {@code equals} the second. */ public static BinaryPredicate equalityPredicate() { return EqualityPredicate.predicate; @@ -967,7 +968,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument == the second + * first argument {@code ==} the second. */ public static BinaryPredicate identityPredicate() { return IdentityPredicate.predicate; @@ -982,7 +983,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument == the second + * first argument {@code ==} the second. */ public static BinaryIntPredicate intEqualityPredicate() { return IntEqualityPredicate.predicate; @@ -997,7 +998,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument == the second + * first argument {@code ==} the second. */ public static BinaryLongPredicate longEqualityPredicate() { return LongEqualityPredicate.predicate; @@ -1012,7 +1013,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument == the second + * first argument {@code ==} the second. */ public static BinaryDoublePredicate doubleEqualityPredicate() { return DoubleEqualityPredicate.predicate; @@ -1028,7 +1029,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument !equals the second + * first argument {@code !equals} the second. */ public static BinaryPredicate inequalityPredicate() { return InequalityPredicate.predicate; @@ -1043,7 +1044,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument != the second + * first argument {@code !=} the second. */ public static BinaryPredicate nonidentityPredicate() { return NonidentityPredicate.predicate; @@ -1058,7 +1059,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument != the second + * first argument {@code !=} the second. */ public static BinaryIntPredicate intInequalityPredicate() { return IntInequalityPredicate.predicate; @@ -1073,7 +1074,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument == the second + * first argument {@code ==} the second. */ public static BinaryLongPredicate longInequalityPredicate() { return LongInequalityPredicate.predicate; @@ -1088,7 +1089,7 @@ public class CommonOps { /** * Returns a predicate evaluating to true if the - * first argument != the second + * first argument {@code !=} the second. */ public static BinaryDoublePredicate doubleInequalityPredicate() { return DoubleInequalityPredicate.predicate;