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

de.hakenadu.terms.visitor.eval.op.UnaryNumberOperationEvaluator Maven / Gradle / Ivy

Go to download

A light extensible java 8+ library for creating composites of terms which are evaluatable using a visitor pattern.

The newest version!
package de.hakenadu.terms.visitor.eval.op;

import java.util.List;

/**
 * convenience interface for {@link NumberOperationEvaluator} implementations
 * which operate on exactly one operand.
 * 
 * @author Manuel Seiche
 * @since 21.01.2020
 */
public interface UnaryNumberOperationEvaluator extends NumberOperationEvaluator {

	Object evaluateNumber(Number operand);

	@Override
	default Object evaluateNumbers(final List operandValues) {
		if (operandValues.size() > 1) {
			throw new IllegalArgumentException("more than one operand passed to unary operation");
		}

		return evaluateNumber(operandValues.get(0));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy