Package groovyx.gpars.extra166y.Ops

Examples of groovyx.gpars.extra166y.Ops.DoubleReducer


     * Returns a reducer returning the maximum of two double elements,
     * using the given comparator.
     */
    public static DoubleReducer doubleMaxReducer
        (final DoubleComparator comparator) {
        return new DoubleReducer() {
                public double op(double a, double b) {
                    return (comparator.compare(a, b) >= 0) ? a : b;
                }
            };
    }
View Full Code Here


     * Returns a reducer returning the minimum of two double elements,
     * using the given comparator.
     */
    public static DoubleReducer doubleMinReducer
        (final DoubleComparator comparator) {
        return new DoubleReducer() {
                public double op(double a, double b) {
                    return (comparator.compare(a, b) <= 0) ? a : b;
                }
            };
    }
View Full Code Here

TOP

Related Classes of groovyx.gpars.extra166y.Ops.DoubleReducer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.