All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.machinezoo.noexception.throwing.ThrowingDoubleUnaryOperator Maven / Gradle / Ivy

Go to download

Makes exception handling concise and beautiful, yet architecturally clean and flexible.

There is a newer version: 1.9.1
Show newest version
// Part of NoException: https://noexception.machinezoo.com
package com.machinezoo.noexception.throwing;

import java.util.function.*;
import com.machinezoo.noexception.*;

/**
 * Variation of {@link DoubleUnaryOperator} that allows throwing checked exceptions.
 * {@code ThrowingDoubleUnaryOperator} is usually implemented by a lambda
 * and passed to {@link CheckedExceptionHandler#fromDoubleUnaryOperator(ThrowingDoubleUnaryOperator)}.
 * See noexception tutorial.
 * 
 * @see CheckedExceptionHandler#fromDoubleUnaryOperator(ThrowingDoubleUnaryOperator)
 * @see DoubleUnaryOperator
 */
@FunctionalInterface public interface ThrowingDoubleUnaryOperator {
	/**
	 * Variation of {@link DoubleUnaryOperator#applyAsDouble(double)} that allows throwing checked exceptions.
	 * 
	 * @param operand
	 *            see {@link DoubleUnaryOperator#applyAsDouble(double)}
	 * @return see {@link DoubleUnaryOperator#applyAsDouble(double)}
	 * @throws Exception
	 *             if unable to complete
	 * @see CheckedExceptionHandler#fromDoubleUnaryOperator(ThrowingDoubleUnaryOperator)
	 * @see DoubleUnaryOperator#applyAsDouble(double)
	 */
	double applyAsDouble(double operand) throws Exception;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy