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

org.meteoinfo.data.mathparser.ExpressionBase Maven / Gradle / Ivy

There is a newer version: 3.8
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meteoinfo.data.mathparser;

/**
 *
 * @author yaqiang
 */
public abstract class ExpressionBase implements IExpression{

    @Override
    public abstract int getArgumentCount();

    /**
     * Validates the specified numbers for the expression
     *
     * @param numbers The numbers to validate
     */
    protected void validate(Object[] numbers) {
        if (numbers == null) {
            throw new IllegalArgumentException("numbers");
        }
        if (numbers.length != this.getArgumentCount()) {
            throw new IllegalArgumentException("Invalid length of Array");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy